HELP! doodle jump style game and falling.
diegocs
Member Posts: 531
in my plataformer (resembles doodle jump in some way) i can't figure out how to make it so when my character falls it a certain distance it dies. just like in doodle ump. do any any of you know how to do this
Comments
To get help from Tshirtbooth you can also try here when the site will be back: http://gshelper.com/
Anyways, just to let you know how I will do it (I'm actually working on a game where I need that):
I would make an actor attribute called something like start_falling_distance.
Then when the character enters in the falling state I record he's position on Y. If you don't have setup a falling state then you should make a test rule to determine when the character is falling and record the Y position then.
The trick is to record only once that position so it won't update constantly as it falls as that won't do any good. I think you can use a timer for that: when the character enters falling state -> start timer: for 0.01 seconds change attribute start_falling_distance to actore Y position.
After this all you have to do is the setup another rule for dying. The rule should be like this:
First you need to test that the actor is in falling mode. The if it's true test the current actor Y position the the start_falling_distance. When it's equal or bigger destroy the actor.
Like I said, I don't know if it will work but I think it will... I also need this setup for a game I'm working on