I have used variables for my game. When character walking over lava the health will go down with -1 but the meter continue to count down as long as the character stands on the lava spot. How do I just get -1 point when touching lava. The same with health it goes up up until I move away from it. I used the example from the stage monitor (last ex)
http://wiki.scratch.mit.edu/wiki/Tutorial_About_Variables
THanks.
Offline
zippolulu wrote:
I have used variables for my game. When character walking over lava the health will go down with -1 but the meter continue to count down as long as the character stands on the lava spot. How do I just get -1 point when touching lava. The same with health it goes up up until I move away from it. I used the example from the stage monitor (last ex)
http://wiki.scratch.mit.edu/wiki/Tutorial_About_Variables
THanks.
i probably am wrong (seeing how i dont know much about what i am talking about) but in theory, would one of those stop buttons work, in the motion tab? put it in the forever block, and it might just stop that script, until you trigger the lava again.
Offline
slammer111 wrote:
zippolulu wrote:
I have used variables for my game. When character walking over lava the health will go down with -1 but the meter continue to count down as long as the character stands on the lava spot. How do I just get -1 point when touching lava. The same with health it goes up up until I move away from it. I used the example from the stage monitor (last ex)
http://wiki.scratch.mit.edu/wiki/Tutorial_About_Variables
THanks.i probably am wrong (seeing how i dont know much about what i am talking about) but in theory, would one of those stop buttons work, in the motion tab? put it in the forever block, and it might just stop that script, until you trigger the lava again.
sry, control tab, not motion
Offline
To keep it from continually reducing your health, you should tell the script to wait until it's no longer touching the lava, like this:
if <touching color red> change health by -1 wait until <not touching color red>
(Just remember that this script needs to be separate from the one for movement, otherwise it will freeze once you touch lava.)
Offline