Subtracting points affecting high score

JmattocksJmattocks Member, PRO Posts: 54

I've created a game that awards 2 points for hitting an object, but it costs 1 point to spawn a projectile. (when Actor A collides with Actor B change game.score to game.score+2) (Actor B has an attribute: change game.score to game.score-1) At first I had it set to hitting an object awarded 1 point but costs 0 to spawn and the high score was working fine. Now, however, the addition of creating a spawn cost is affecting my high score. At the end of my game I display my high score. I've got it set to if game.score > game.bestscore change attribute game.bestscore to game.score. I also save the attribute to a keyword and load that attribute before displaying the highs core. Somehow, for example I would score a 6 and it would display 6 as my high score, but when I reset the game and try again and get a 3 it displays 3 as my new high score and forgets about getting a 6 on the previous attempt. Is there something I can do to fix this?

Best Answer

  • gyroscopegyroscope I am here.Posts: 6,598
    edited April 2014 Accepted Answer

    Hi @Jmattocks By the sound of it – (if I understand you correctly) - what's happening is your score attribute isn't being reset when a new level or game is played, so try the following, in an actor outside of the play area, on the beginning of a new scene/level or game (difficult to be more precise without seeing your particular setup) simply add:

    Rule: Change Attribute game.score to 0
    

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Answers

Sign In or Register to comment.