How do I spawn a "power up" that dissapears after x seconds?

Just started using Construct 2? Post your questions here

Post » Mon May 18, 2015 7:06 pm

Hello everyone!

I am making an endless jumper game at the moment and i got pretty far.

I want to make the following :

- When my player hits a certain power up item, i want it to spawn a rocket on top of the player.
- When the rocket has spawned on to the player, i want it to travel up for an "x" amount of seconds before it throws it self off.
- After the rocket ship has fallen off the player, i want it to destroy it self and continue the game as normal.

Any tips on how i can do the above ?

I have come so far that when my player hits my power up, that it spawns the rocket and travels up.
The only problem is that it does not stop going upwards.

Any help is apprectiated!

Thanks in advance
B
6
S
1
Posts: 8
Reputation: 416

Post » Mon May 18, 2015 7:15 pm

You could use the timer behaviour and drop the player on timer..
You could also drop the player based on it's y-position..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon May 18, 2015 7:24 pm

Thanks for the tip!
Never thought about the timer behavior.
B
6
S
1
Posts: 8
Reputation: 416

Post » Mon May 18, 2015 9:15 pm

If you just need it to disappear, use Fade. Fade in=0, Wait = x, Fade out = 0.01, Leave Destroy = After fade out. That will fade out instantly.
ImageImageImage
B
71
S
21
G
232
Posts: 3,695
Reputation: 129,866

Post » Thu May 21, 2015 10:04 pm

I basicly want to do it like this :

- Player picks up Power up
- Rocket ship "pins"itself to player and fly for x seconds
- Rocket ship destroys it self by falling down to the screen. Basicly a pull towards down.

I have tried the timer but i can try and use fade also.
B
6
S
1
Posts: 8
Reputation: 416

Post » Thu May 21, 2015 10:31 pm

Then you are looking at both. Use a timer to time how long to fly up, on time-out, change the (I'm assuming bullet behaviour), so that it will move at an angle down, changing the rotate properties maybe, depending on what you want, using the fade behaviour so that it destroys the sprite eventually (you could use Destoy-outside-layout too, again depending on what you want).
ImageImageImage
B
71
S
21
G
232
Posts: 3,695
Reputation: 129,866

Post » Fri May 22, 2015 7:18 pm

Got it to work now pretty much.
Could be more codes used in to in to make exactly what i want.

Thanks for the tips all! :)
B
6
S
1
Posts: 8
Reputation: 416


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests