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.

DarkBASIC Discussion / Is the high score saved

Author
Message
learner
16
Years of Service
User Offline
Joined: 7th Mar 2009
Location:
Posted: 19th Mar 2009 00:16
How do i check if a high score has been saved,when the program is first used by another person?.

Thanks
Wizzkid
AGK Tool Maker
18
Years of Service
User Offline
Joined: 14th Aug 2006
Location: Northern Ireland
Posted: 19th Mar 2009 00:24
Well I am guessing that your program creates a file which would store the highest score, so in this case you could just check if that file exists:



Hope that helps, although if you give us a bit more information next time we will be able to help you more.

Wizzkid


FireBASIC - The Heart of Great Programming - http://firebasic.ablazegaming.co.uk
learner
16
Years of Service
User Offline
Joined: 7th Mar 2009
Location:
Posted: 19th Mar 2009 01:04
I`ve written a small program where the user translates words from one language to another.To give a bit of incentive to use the programme,i want to save and load a high score.I am using save/load array.I`m a bit confused how to get this high score started.

Thanks again
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 19th Mar 2009 02:28
Could you supply some code so that we can see how you're doing it?

~QJ
That's what they WANT you to think...
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 19th Mar 2009 05:38
if file exist("Array.arr")
load array "array.arr",array(100)
endif

New Site! Check it out \/
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 19th Mar 2009 22:26
I meant learner.

~QJ
That's what they WANT you to think...
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 19th Mar 2009 23:39
i know i was putting in my oppinion lol

New Site! Check it out \/
learner
16
Years of Service
User Offline
Joined: 7th Mar 2009
Location:
Posted: 19th Mar 2009 23:41
I have`nt done any code to check if the file exists yet.
I`ve got a score and high score and just check if the score>high score.
I was thinking of something like,check if the high score has been saved and if it has been load it into the program then update it if it is beaten.
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 19th Mar 2009 23:41
DB does not automatically save scores: you have to do that yourself.

~QJ
That's what they WANT you to think...
learner
16
Years of Service
User Offline
Joined: 7th Mar 2009
Location:
Posted: 19th Mar 2009 23:56
Yes,i`m using the save array command.
What i`m trying to explain is,when i give the program to someone,i think i need to check if the saved high score exists to get it started.
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 20th Mar 2009 00:00


Just stick this in the top of your code.

~QJ
That's what they WANT you to think...
learner
16
Years of Service
User Offline
Joined: 7th Mar 2009
Location:
Posted: 20th Mar 2009 00:08
What about something like>
Check if the saved high score exists.
If it does load it and print on screen.
If it does`nt print 0 in the high score.
Then save it when its beaten.
learner
16
Years of Service
User Offline
Joined: 7th Mar 2009
Location:
Posted: 20th Mar 2009 00:09
Thanks
I sent my post before i read yours.

Login to post a reply

Server time is: 2025-05-17 03:45:43
Your offset time is: 2025-05-17 03:45:43