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

  • 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

  • You could use the timer behaviour and drop the player on timer..

    You could also drop the player based on it's y-position..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the tip!

    Never thought about the timer behavior.

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

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

  • 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).

  • 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!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)