ID:178187
 
In that demo, how would you make it if you fell off a cliff of like, 10 tiles high you take damage?
FireEmblem wrote:
In that demo, how would you make it if you fell off a cliff of like, 10 tiles high you take damage?

I probably haven't checked out that demo, but it should be the same for pretty much any sidescroller.

When the tile below you is not dense, then when you Enter() it, perhaps a counter can increase by one (a mob var) until they reach the ground. If it is > 9, then do the damage.

- Malver
In response to Malver
first make the ground turf and then an invis turf named Damageturf.. place the damage turf above the ground turf... like this,

example:

Damageturf - d
ground - g

dddddddddddddddddddddddddddd
gggggggggggggggggggggggggggg

then add this code,




turf/Damageturf
Enter(O)
usr <<"You hit the ground!"
usr <<"Ouch.. You take some damage!"
//Damage code here.
Deathcheck()

mob/proc/Deathcheck()
if(src.Health == 0)
world <<"[src] Has died!"
src.Move(locate(1,1,1))
else
..()
In response to ShadowSiientx
Well, you see, that's not what he wants. He wanted it so that when you fall 10 spaces, you take damage. Not every time you fall.
In response to Garthor
Maybe he does this.. make a cliff.. and Put the damage turf 10 SPACES UNDER THE CLIFF.. AND only put it there. so you only take damage when uf all off.
In response to ShadowSiientx
what if you jump off the ground and land on the space under that cliff?