Decreasing score count help?

VGXVGX Member Posts: 796
edited November -1 in Working with GS (Mac)
Hi I'm having trouble working this out.

My game involves doing something in the LEAST amount of moves. I have a 'score' count and a 'top score' count. How do i get the 'top score' count to change to match the score if the current game has used less moves than before?

(E.g. First play 53 moves, second time in 40 moves, so top score should change from 53 to 40)

Thanks

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Think I get what you're after; try two integer attributes, Move and TopScore.

    Each move needs the Rule: change attribute Move to Move + 1

    Another Rule after all the moves have been done, When Move < TopScore
    Change Attribute TopScore to Move.

    Gives you something to work on; hope it helps out.

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

  • VGXVGX Member Posts: 796
    Thanks, that makes sense, except I've just realised that when you go to play again (there is a restart button), the game score resets to 0, and because of the rule,

    'When Move < TopScore - Change Attribute TopScore to Move'

    that makes the TopScore match it at 0. How can I fix this please?
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    It sounds like you've got the Rule: 'When Move < TopScore - Change Attribute TopScore to Move' in the restart button? Without seeing the whole project, I'm guessing, change the line:

    'When Move < TopScore - Change Attribute TopScore to Move'

    to
    'When Move < TopScore
    AND When Move does not equal 0
    Change Attribute TopScore to Move'

    Bit unsure when you're changing Move to 0 in your Rules but that should work, I think.

    Just thought, putting Change Attribute Move to 0 after 'When Move < TopScore - Change Attribute TopScore to Move' should work as well.

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

Sign In or Register to comment.