0 Favourites

timer problem

  • <img src="http://neuropod.net/imagehost/uploads/c2c5e7c0d791ca292c1619b51f2518e0.png" border="0" />

    Bomb is thrown by PirateWithBomb upwards then falls down on ground.

    What I want to do:

    I want the bomb to change animation to "OnGround" and start a one second timer before destroying itself and spawning explosion object.

    Problem:

    The explosion object is already spawn just as bomb is falling down (which I already counted as 1 second AFTER the bomb was spawned by PirateWithBomb).

    How can I make it work like I wanted it to?

  • Does the bomb also change to OnGround while falling ?

  • At least you should switch the bomb destroy and bomb spawn action, If the bomb explodes earlier then expected it's not in these events.

    Why does the bomb have platform behaviour? Does it walk and jump?

  • plinkie

    No. The OnGround animation plays when the bomb has landed on the floor (which is correct). But the timer is starting as soon as the bomb is spawned.

    these are all the codes of PirateWithBomb

    <img src="http://neuropod.net/imagehost/uploads/f39ff3afdfe57b6a58e35264f82c5442.png" border="0" />

    Just to recap how it is supposed to work:

    Bomb is spawned at frame 2 (binded at frames 2 and 3). Bomb should NOT explode while in frames 2 and 3 of PirateWithBomb. Bomb is thrown upwards and then falls down on floor. Bomb should play animation OnGround as soon as it lands on floor. Bomb should start a 1-second timer to destroy itself and spawn explosion.

    The bomb should destroy itself and spawn explosion upon contact with playerBox anytime AFTER frames 2 and 3.

    Also, some other issues:

    • the bomb thrown already "seems" to go back to being bind to PirateWithBomb after it was thrown. I want the bombs (individually) to not be controlled/bind after frame 3 (or AFTER it was THROWN) of PirateWithBomb

    LittleStain

    What's a good replacement for platform behavior based on the intended use?

    Nope. The bomb is just thrown. It doesn't walk or jump. I have tried simulating jump to make the bomb go up, but it did not work, so I used vector X instead.

    I thought of using platform because I thought I needed the condition "On landed" or "Is on floor", but either of those don't work.

  • also, another issue is when the PirateWithBomb is spawning the bomb at frame = 2, if I REMOVE the "Every X seconds" condition, the PirateWithBomb spawns like multiple bombs all at once.

    I just want a single bomb spawned at the first tick of the frame 2.

    Did I do it right?

  • Change OnLanded to on collision with the floor object and see if it's still broken.

  • plinkie

    ok. tried it. did not worked.

    I noticed something. Right now, the PirateWithBomb is throwing the bomb at a stairway. If the bomb falls on a lower ground level AND the PIratewithbomb is already in frame = 2 AGAIN, the bomb binds back to Piratewithbomb (and not play OnGround)

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • I don't like this logic being triggered by animation frame. If the player moves the character or in future you allow the player to do different things that cut the throw anim out halfway through all the logic is gonna mess up. I would set up some functions for throwing the bomb then detecting if it hits the floor and destroying it. You have a load of different logic hooked up to when animation frame = 2 as well which could be causing conflicts. I would definitely avoid using the anim frame stuff to trigger this fairly simple logic.

  • And don't forget picking the bomb you want to affect in your event.

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