0 Favourites

Falling problem

  • Hello. i'm working on a game where the player has a rocket in the back

    and has to fly up from one platform to another. When runs out of fuel, hits an enemy or obstacles the player will fall and die.

    I don't want the player to keep falling

    the entire layout(it's pretty big) but instead to die after a few seconds of falling and play again. Do you know how i could achieve that?

  • use a booelan on your character, and switch to "true" when runs out of fuel, etc.

    then use System -> Wait -> to give a few seconds falling before play again.

  • You could use an array to store the players X and Y position at time of death then as puntodamar said, using a wait function that is only triggered once , once the player dies, would spawn them back at the stored array position?

  • yeah, that would work.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • well i tried a few times, but it was more of a guess since i

    never used array before and i didn't manage

    do solve anything. Could you guys please be more precise, or

    maybe provide an example?

  • For the delayed death, use a timer. Just add the Timer behavior to your player and set an OnTimer trigger to kill it. Then you just put it wherever you want (be it the beggining of the level or the place where it died.

  • This was done really quick so it would need cleaning up and implementing better but it gets the point across. Create an array object ( in my case i called it Player_Positsion, Yes I spelt it wrong haha told you I did it quickly ) with a width of 2. Next we tell the array to store the location of the players current animations image point 0 ( you could also use Player.X + Player.Y, you dont need to use the image point ) Then after storing the values we get the game to put the player back where he was the first time he touched the object. Hope this helps.

  • if you can't use array yet, save them with instance variable

  • I tried this and works, but there is still one

    thing i tried for a few days and couldn't figure out.

    1. Sometimes the player doesn't have collision

    with anything, simply dies from falling, there aren't

    platforms to jump on, therefore falls.

    I tried to change instead of on collision with, to add

    compare Y, but didn't worked.

    Btw i changed "set position to" to go to layout since i want a panel with a score to appear after the player dies.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
168 15,524
Lumicreative's avatar
Lumicreative
Unread hot topic
98 7,602
norum82's avatar
norum82
Unread hot topic
87 5,380
facecjf's avatar
facecjf