IOCT Masters in Creative Technogies
Major Project
An augmented reality game based on "Breakout"

Thursday 24 July 2008

Save the high scores

A similar method is used when saving the high scores, as the method for reading the high scores. Instead, to save the high scores the external file is written to, using “fileHandle = fopen(“highscores.txt”,”w”);”.

This line of code opens the relevant file for writing and I have then used “fprintf” to write a string (the player name), tab a space, an integer (the player score) and created a new line. To end this command, I have then used the code line “fclose(fileHandle);”.