Topic: How do you store a High Score Value ?  (Read 2327 times)

Author Message

0 Members and 1 Guest are viewing this topic.

Offline HeadingtonBard

  • C128
  • ****
  • Posts: 272
  • Kudos 12
  • Gender: Male
    • View Profile
    • Alex Aris Games
How do you store a High Score Value ?
« 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. :)



:: HeadingtonBard ::

[ http://www.alexarisgames.co.uk/ ]



Why not check out Google Play Store for more games to buy and for *FREE* with no adverts or nag screens !

Offline porchy

  • Moderator
  • Amiga 4000
  • ******
  • Posts: 825
  • Kudos 33
  • Gender: Male
    • View Profile
    • JAMMArcade
Re: How do you store a High Score Value ?
« Reply #1 on: April 15, 2012, 08:45:33 PM »
Is lasthighsc global also?

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

Offline HeadingtonBard

  • C128
  • ****
  • Posts: 272
  • Kudos 12
  • Gender: Male
    • View Profile
    • Alex Aris Games
Re: How do you store a High Score Value ?
« Reply #2 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 ?

:: HeadingtonBard ::

[ http://www.alexarisgames.co.uk/ ]



Why not check out Google Play Store for more games to buy and for *FREE* with no adverts or nag screens !

Offline muguk

  • Sarcastic Git plc!
  • Administrator
  • Amiga 4000
  • ******
  • Posts: 3500
  • Kudos 32
  • Gender: Male
  • Mug U.K(tm)
    • View Profile
    • Mike's Word Toolbox
Re: How do you store a High Score Value ?
« Reply #3 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?

Offline porchy

  • Moderator
  • Amiga 4000
  • ******
  • Posts: 825
  • Kudos 33
  • Gender: Male
    • View Profile
    • JAMMArcade
Re: How do you store a High Score Value ?
« Reply #4 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  ;)

Offline HeadingtonBard

  • C128
  • ****
  • Posts: 272
  • Kudos 12
  • Gender: Male
    • View Profile
    • Alex Aris Games
Re: How do you store a High Score Value ?
« Reply #5 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 ! ;)
:: HeadingtonBard ::

[ http://www.alexarisgames.co.uk/ ]



Why not check out Google Play Store for more games to buy and for *FREE* with no adverts or nag screens !