High Scores for processing game !VERY URGENT!

edited January 2017 in How To...

okay so I need help with how to create a high score board for a slings and arrows game I am making for my computer studies course summative the rubric says I need to use file I/O in my code to create a high score table that will be displayed when you loose or win my game and I have no idea how to do it please can you help me.

Tagged:

Answers

  • edited January 2017 Answer ✓

    You could have a high score during one session

    When your game has a restart you could have 6 games in a row and every time see a high score (of yourself or you and your friend)

    Simple - and no file i/o required

    Can you do this? Like showing a high score after the game and restart?

    This is already quite hard... you need a proper state system to tell the program in which state it is.

  • edited January 2017 Answer ✓

    @neshki --

    the rubric says I need to use file I/O in my code

    In the reference, look up the section under Input > Files -- there are many useful functions there that support different approaches.

    In particular check out loadStrings (if you want to load and save raw data) and loadTable() (if you want to load and save more structured, tabular data).

    You can use text, XML, JSON, or whatever you like to store your data. As you will see from past discussions (linked above), one general pattern might be:

    1. on sketch start: load a table file into a Table object
    2. when display of high scores is requested: use the Table object to display scores
    3. when a new high score is recorded: save it to the Table object and then save the Table object back to the table file.
Sign In or Register to comment.