RCM - RETRO COMPUTER MUSEUM

GENERAL => CODING AREA => Topic started by: HeadingtonBard on April 15, 2012, 06:07:11 PM

Title: How do you store a High Score Value ?
Post by: HeadingtonBard on April 15, 2012, 06:07:11 PM
Hi ! :)

I have a score variable that equals to a lastscore variable ( global ).

score = 12345
lastscore = score

This works fine, however I am trying to add the lastscore to a lasthighsc variable and this figure is being forgotten once the game is replayed. Surely, storing lasthighsc variable shouldn't clear itself ?

Cheers,

Alex. :)



Title: Re: How do you store a High Score Value ?
Post by: porchy on April 15, 2012, 08:45:33 PM
Is lasthighsc global also?

Can you give any more addition info?
What language, code snippets, etc
Title: Re: How do you store a High Score Value ?
Post by: HeadingtonBard on April 16, 2012, 07:12:13 PM
Is lasthighsc global also?

Can you give any more addition info?
What language, code snippets, etc

I am basically using GameMaker, but using its GML ( GameMaker Language ). Similar to C++ in a little way. But a variable is a variable, so it should be similar in most languages.

lasthighsc is global. I need to copy or remember the high score, if the last score is equal to or greater, then it will be replaced. Sorry if it sounds a bit confusing. Perhaps the lasthighsc is being reset somewhere ?

Title: Re: How do you store a High Score Value ?
Post by: muguk on April 16, 2012, 07:24:08 PM
If I was using VBA (Excel/Word), I'd be putting copious Debug.Print variablename throughout the code plus some location text to see which subroutine it was in when it gets reset?  Can this be done in GM?
Title: Re: How do you store a High Score Value ?
Post by: porchy on April 16, 2012, 07:41:55 PM
I'm very familiar with c++ and would normally add a watchpoint on that variable but not sure what game maker offers in terms of debug.
Without looking at the code I don't think I can be much more help sorry mate
That said, even with looking at the code I may be able to help  ;)
Title: Re: How do you store a High Score Value ?
Post by: HeadingtonBard on April 16, 2012, 08:10:03 PM
I have just run the project with debug on and a score value is reset after each level. It's crazy, the project is Shapes - Mindorama and I am just adding a Last Score and Last Level Played. I'll try and knock up something with the Fartoids GameMaker Project and anyone can have a prod around with it ! :)

Thanks for the pointers, watch this thread ! ;)