scoring

MitchMan97MitchMan97 Member Posts: 51
edited November -1 in Working with GS (Mac)
Hi i was wondering how i can add points for every second that my actor is alive how do i do that?

Comments

  • DrGlickertDrGlickert Member Posts: 1,135
    Yes. Do you want it to continuously update? Or, just add to the score at the end?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    make a integer attribute called score and a boolean attribute called addToScore.

    whenever you start the game have a change attribute behavior changing addToScore to true

    make a rule when attribute addToScore is true
    then put a timer in that rule every 1 second
    then put a change attribute behavior in that timer and change attirubte score to score+1 (or however much you want to add every second)

    then whenever the player dies, its game over, or you want the score to stop adding, change attirubte addToScore to false
  • PhoticsPhotics Member Posts: 4,172
    MitchMan97 said:
    Hi i was wondering how i can add points for every second that my actor is alive how do i do that?

    Every actor has it's own clock... the self.time attribute. One easy way to add that to the main score is to add self.time to the game.score when the main character dies or completes the level... like a bonus.
  • MitchMan97MitchMan97 Member Posts: 51
    @JohnPapiomitisit
    now it goes from 0-1 like its supposed to but it doesn't keep going?
Sign In or Register to comment.