Question: How To Add Bonus Points Based on Time Remaining

dazzlemedazzleme Member Posts: 152
edited November -1 in Working with GS (Mac)
Hello fellow salad makers, I couldn't find the exact answer I was looking for in the forums or on YouTube, so am hoping this post will result in some advice. What I would like to do is add bonus points to the score for each second that remains once the timer stops; I would appreciate your input on how to best do this.

In my game, I've got a timer set to count down from 60 seconds. If the objective is accomplished, the timer stops. I've set up a score attribute so that for each milestone reached during the 60 seconds, the score increases. I've also got an attribute for the high score.

I got "close" to accomplishing what I was trying to do, but it wasn't fully completely successful and I think the implementation wasn't as clean as it could have been. Any suggestions would be greatly appreciated - or even pointing me to a YouTube video or thread in the forums. I searched both, but am not too prideful to admit I could have easily missed the right one. ;)

Comments

  • JeffreyShimaneJeffreyShimane Member Posts: 372
    I assume for your countdown timer, you are using a timer that increments a countdown game attribute (with a value of 60) -1 every 1 second. Once the objective is reached and the timer stops, multiply the value of the countdown game attribute by whatever bonus amount you want (e.g. 100 points per second) and add it to your score (e.g. 20 seconds left x 100 points per second = 2,000 bonus points added to the player's score).

    - Jeff
  • dazzlemedazzleme Member Posts: 152
    Thanks Jeff, that worked great - I appreciate your help!!!

    For those who may search and find this thread down the road, here's how I implemented Jeff's advice.

    In an actor I named "bonus_score", I set up the following rule:

    When Attribute "game.stopClock" is "true"

    Constrain Attribute: "game.Bonus_score" To: "game.timer*100"
Sign In or Register to comment.