Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / high scores

Author
Message
GZMGames Admin
19
Years of Service
User Offline
Joined: 15th Feb 2005
Location: vermont
Posted: 1st Apr 2005 12:47 Edited at: 1st Apr 2005 12:48
how do i make a high score thing on my game? If someone gets a high score they would proabably want it posted in there game.

Games made with passion
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 2nd Apr 2005 01:31
I think there is a high score codeing in code base.

which way are you going to use your high score.

1. only while game is running.

2. reload old high score when game starts.

In Space No One can Hear You Scream! (When your comm Line is cut?)
BadMonkey91
20
Years of Service
User Offline
Joined: 13th Jan 2004
Location:
Posted: 2nd Apr 2005 01:37
you've gotta create a file, like a .dat, then write your variables to it. It's in the tutorials

Badmonkey91@hotmail.com
GZMGames Admin
19
Years of Service
User Offline
Joined: 15th Feb 2005
Location: vermont
Posted: 3rd Apr 2005 03:59
well the high score type thing im trying to make will be if the character dies and gets a high score i want to let them put that in the hight score list so kind of an in game.

GZM$="what?" <<<i know thats not an actual command lol
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 3rd Apr 2005 05:27
well youll need to store the high score as a file in a number, then load that file, read the number and put it on. Just say something like "if score>highscore then score=highscore and save=1" then you would just say if save=1 then make a file, write the number, etc.

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
GZMGames Admin
19
Years of Service
User Offline
Joined: 15th Feb 2005
Location: vermont
Posted: 3rd Apr 2005 09:16
oh so make an entire new file for the high score and yea do what you said ok

GZM$="what?"
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 3rd Apr 2005 14:31
yeah then when a new high score comes in just overwrite that file. I think thats how ur supposed to do it , ive never actually tried it, but ive heard the theory of it.

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 4th Apr 2005 00:02 Edited at: 4th Apr 2005 00:03

at the start of your code will load a saved highscore the next time the code is run, at the end of the game (in the exit or death sequence) add the lines


this will remove the old high score if it exists and write the latest one to the file hi.sco, so the first time your program saves the file it will not erase the old score(since there isnt one), but create a file and save the new high score, the next time the game is run the old score will be removed, then a new high score file will be written with the new score, but only if the new highscore (Game_Highscore) is higher than the old highscore, otherwise the original highscore stands (ie nothing is altered since the first condition is false).

Mentor.

PC1:XP, P4 3ghz, 1gig mem, 3x160gig hd`s, Radeon 9800pro, 6 way speakers.
PC2: Linux, AMD 2ghz, 512mb ram, FX5200 ultra, 16 bit SB.
PC3: XP, laptop, intel 2.6ghz celeron, ATI mobility 9000, 256mb

Login to post a reply

Server time is: 2024-09-23 17:28:18
Your offset time is: 2024-09-23 17:28:18