Anybody knows how to kill, end, etc. in a platformer if you fall from a long distance? thanks in advance :)
This is how I managed to make it work using 2 variables:
First one will control the initial Y position of the player from the fall and the other one will tell when the player is falling.
The best way that I see to do this is:
1. have an invisible detector sprite extending out a bit from the bottom of the player sprite, always set to the player's position. This will be useful for many things.
If player.platform.VectorY > (say 1000)
detector: on collision with ground
then kill player.
EDIT: tuiii, you beat me to it... however my version uses no variables.
I first created like sqiddster suggested but VectorY is limited to the Max fall speed so if you want to make it die when falling from very high distances only, you would have to raise the max fall speed a lot and maybe you wouldn't want it to fall that fast.
But if that's not a problem you could use VectorY and save space for more events if needed :}
Well, since you never go faster than the max fall speed...
it is unrealistic if you die by height, and not speed.
You might as well raise the max fall speed.
+Player is falling
-Add 60*dt to instance variable 'fall length'
+Player is on ground
+'fall length' > some good distance
+'fall length' < some good distance
-set 'fall length' to 0
Should work just fine if there are no abilities that allow the player to float or something. Might also want to set 'fall length' back to 0 if there's a wall kick or something.
I can't get none of these working, they always keep calculating from initial position. I need my position to update upon landing under max fall height.
Its actually simpler than that (Sorry for my english)
If its platform here is an example, its a single variable what controls everything and in a platform it detects if its in the ground or falling so its just a matter of comparing the number that gives you while falling and if its high enough well just insert your animations etc, if not it will compare while its on the ground if its still alive and reset the variable which controls the fall.
Tell me if it was usefull and if this was what you were looking for, (I use construct 2 on a Mac so if you can't open it, i'll post a screenshot of the event sheet)
andrefabud your CAPX works very well my friend and Tuiii your link has error 404
Develop games in your browser. Powerful, performant & highly capable.
Add this event: Player/Platform is Falling
to the On collision of your enemy and player.