Results 1 to 5 of 5

Thread: How To Save And Modify A 'high Score'?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2005
    Posts
    18

    Question How To Save And Modify A 'high Score'?

    I've created a game and would lke to be able to save the players high score. to help with the code the high score in my game would = 'offer'

    I assume i would save the high score to a txt file? but have never done this before.

    Nick

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How To Save And Modify A 'high Score'?

    Not a lot of information to go on, so my response will be kind of general. To save something to a text file, use:
    VB Code:
    1. Open "C:\Score.txt" For Append As #1
    2. Print #1, What_you_use_to_store_the_score
    3. Close #1

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Dec 2005
    Posts
    18

    Re: How To Save And Modify A 'high Score'?

    Thanks Hack,

    that'll get me started, but if i wanted to create a form that displayed 'top 10 scores'. How would i access the txt file and display the top 10 scores when the form is loaded?

    let me know if there is any more info you need.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How To Save And Modify A 'high Score'?

    Tell me exactly how this text file is going to be structured.

    I'm sure it will contain more than just a bunch of numbers.

    How will you associate a number (score) with a name (of the person that scored it)?

    Other than name and score, what else is going to be in there, and in what order?

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Dec 2005
    Posts
    18

    Re: How To Save And Modify A 'high Score'?

    example of saved 'top score' file:

    £32,500 <tab> John
    £5,000 <tab> Dave
    £250,000 <tab> Mark
    ------------------------------------------
    If it makes things eaiser, the score doesn't have to be saved as a £ value - just an int.

    I will provide the user with an input box to input their name and their top score is calculated automatically at the end of the game (there is only ever 1 user at a time).

    This is all i have decided at the moment, and its quite flexable if we need to change things!
    Last edited by nick_roberts; Dec 12th, 2005 at 10:08 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width