Falling problem

Get help using Construct 2

Post » Thu Sep 18, 2014 12:47 pm

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?
B
5
Posts: 10
Reputation: 247

Post » Thu Sep 18, 2014 1:38 pm

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.
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
62
S
14
G
2
Posts: 286
Reputation: 6,576

Post » Thu Sep 18, 2014 2:46 pm

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?
B
7
Posts: 61
Reputation: 417

Post » Thu Sep 18, 2014 5:21 pm

yeah, that would work. :)
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
62
S
14
G
2
Posts: 286
Reputation: 6,576

Post » Thu Sep 18, 2014 8:08 pm

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?
B
5
Posts: 10
Reputation: 247

Post » Thu Sep 18, 2014 8:17 pm

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.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
15
S
3
G
1
Posts: 329
Reputation: 2,012

Post » Fri Sep 19, 2014 7:26 am

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.
You do not have the required permissions to view the files attached to this post.
B
7
Posts: 61
Reputation: 417

Post » Fri Sep 19, 2014 4:43 pm

if you can't use array yet, save them with instance variable
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
62
S
14
G
2
Posts: 286
Reputation: 6,576

Post » Tue Sep 23, 2014 8:53 am

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.
B
5
Posts: 10
Reputation: 247


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Syazanie Amirin, tarek2 and 11 guests