Page 1 of 1

Bug with loadVars when creating high score

PostPosted: Fri Nov 25, 2005 3:23 pm
by SanDiego1
I followed the tutorial and created a high score. In my game, the player's score increases by incriments of 100 when certain buttons are pressed and decreases by incriments of 50 when other buttons are pressed. After the player plays the game once and the high score is loaded, the score goes from 0 to some random number like 35084720 when the first button is pressed on the second play of the game. Thereafter, the score will increase by 100 and decrease by 50 with the other buttons. This seems to happen because of the loadVars function. Is there some other way to load or create a high score without the loadsVars function?

PostPosted: Fri Nov 25, 2005 9:23 pm
by makslane
I can't repeat this error here.
Can you send me the game?

PostPosted: Sat Nov 26, 2005 12:20 am
by SanDiego1
Thanks for the help. I think I figured it out. I had put the "Score.textNumber = Score.textNumber + 100" in a Mouse Up Button event. I need the player to mouse click a button to change the score. What I did was put the code in the Script Editor for both the Mouse Up Button event and the Create Actor event. I did this for each button that the player uses to increase/decrease the score. At the end of the game, I have the player left click the final piece of the board so his score is compared with the high score. I again put the same code in the Mouse Up Button event and the Create Actor event. The code compared the high score with the score. On the high score, I loaded the variable using loadVars and the "text.Number = highScoreCount" and it worked. I hope this helps others who need to activate the score with a mouse click rather than a collision.