is this possible?

AdamgoproAdamgopro Member Posts: 310
edited September 2012 in Working with GS (Mac)
ok i have a score system and in this score system i have a streak count whenever i hit an object it bumps up the score and adds +1 to the streak but how do i reset the streak score back to 0 if i hit the wrong object?

basically how do i reset an attribute back to 0

would really appreciate your help :)

Comments

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    Change attribute game.streak to 0
  • AdamgoproAdamgopro Member Posts: 310
    edited September 2012
    @jonmulcahy this is the first thing i tried but it didnt seem to work? does there have to be any symbols before it like = > : ?

  • quantumsheepquantumsheep Member Posts: 8,188
    If player hits wrong object change gamestreak to 0

    That should do it.

    QS
  • AdamgoproAdamgopro Member Posts: 310
    @quantumsheep @jonmulcahy

    Also if i died at end of the game how would i make it show the best streak?

    instead of showing the current streak? as it changes to 0 when i hit wrong object

    is there a way to save attribute of the highest streak i got in the current round?
  • carlblanchetcarlblanchet Member Posts: 755
    edited September 2012
    Make a "best streak" attribute. If "current streak" is > "best streak", change attribute "best streak" to "current streak". Same way that you would record a best score.
  • thilanwijthilanwij Member Posts: 20
    Basically, u just set a rule if the thing you're controlling hits the wrong object, change the attribute (of the streak) to 0 (streak score = 0). If it hits the right object, change attribute: streak score = streak score + 1

    Im currently working on an app that has it where if you collect this block consecutively, keep adding points. But if it passes the paddle (main actor), i put an invisible actor out of the screen and if it hits that, reset the consecutive streak to 0. It works for me!
Sign In or Register to comment.