Can any one help me with scripts for fall damage? I'm programming a game and I want to make a function, which, If you fall for let's say 100 pixels you would take damage or die. I' trying to program it, but I'm having a hard time. Anyone?
Offline
black_eye wrote:
You could try to make the ground sensor time how long it takes for the player to land (as in while it's not touching the ground) and if it's over x seconds, the damage is applied.
Thanks!
Offline
You can either build a counter into your fall loop (see below) or use y-velocity and say "if (y velocity) > (some number), then die.
When I receive [begin to fall v] set [fall v] to (0) repeat until<touching [ground v]?> change [fall v] by (5) change y by (-5) end if<(fall) > (20)> blocks you use to kill sprite go here end
Offline