adding score (time left) from previous level to time left on next level?

timbirks

  • Posts: 75
Hi there, first post!  I'd like to add the score from the first level onto the score for the second level.   The score is the time remaining from each level, so if there is 20 seconds left when completing level 1, I'd like to add that score to however many seconds are remaining when level 2 is completed.  I've created a 'score' and 'TimeLeft' attribute but when set the score to 'score + timeleft' it appears to continually do it over and over, i think this is because it's in an 'always' block, any ideas of how to get it to do the calculation just once?  many thanks for any help.
Super Crash Land v1.2 - Available to Download now from Google Play absolutely free!   

https://play.google.com/store/apps/details?id=com.timbirks.supercrashlandv12

If it is a platformer, then just make a collision actor. When the player hits it, the time stops and is added.

If its a killing game, do an {IF} all are killed, stop time and add it on.

If you want to stay with the same score in each level, just add the behaviour into every scene. Easy. (The score will be carried on to the next scene)
I'm 17 years old, here to help and Entertain. {Also to make fun games}
ADAM: (http://www.stencyl.com/game/play/25588)
Also, if you need help making a platformer, search {Jumper} in Stencyl Forge. This is a player with everything you need in it, that i made. Enjoy!

timbirks

  • Posts: 75
Hi, thanks for the quick reply!    It is a killing game, In an Always block I've put 'If Enemies = 0 , disable behaviour TimeLeft for this scene(this stops the timer), set score to Score (time from previous level) + Timeleft (on current level), it does this calculation but I don't know a way of stopping it from repeatedly doing it.   I'm new to stencyl but I know the solution must be simple, just can't see it!
Super Crash Land v1.2 - Available to Download now from Google Play absolutely free!   

https://play.google.com/store/apps/details?id=com.timbirks.supercrashlandv12

timbirks

  • Posts: 75
I think it's solved, I put the command in an 'Actor Created' event.  'When enemies are Killed, decrement enemies alive by 1.  If Enemies Alive= 0, set score to Score + TimeLeft. 
Super Crash Land v1.2 - Available to Download now from Google Play absolutely free!   

https://play.google.com/store/apps/details?id=com.timbirks.supercrashlandv12

Just don't use an {Always}

If for a second, they are dead. It will do that 60 times in one second! (24 times, 64 time or something. Well you get it anyway)
I'm 17 years old, here to help and Entertain. {Also to make fun games}
ADAM: (http://www.stencyl.com/game/play/25588)
Also, if you need help making a platformer, search {Jumper} in Stencyl Forge. This is a player with everything you need in it, that i made. Enjoy!