[SOLVED]Making a Stacking Time Bomb mechanic

0 favourites
  • 5 posts
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • The goal:

    Hit enemies with a seed projectile which will explode in 3 seconds.

    The more stacks of seed the target has, the more damage it will do. At the time of explosion, stacks should return to 0.

    In Practice:

    This works accordingly. If I apply one, two or three stacks(seedbomb instance variable), it will do the appropriate amount of damage.

    However, after that, each and every hit will subtract one health from the monster as soon as the projectile hits. If I wait a few seconds and try again, the projectile will work as expected.

    My guess is that something is not resetting properly with the 3 second timer and I cannot figure out why.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Make third event as sub event of second event or you can add third event with extra condition of BulletSeed 'on destroyed'.

  • Tried both fixes and I am still having the same problem.

    I want to be able to stack as many stacks as possible within three seconds to reward attack speed and player skill.

    In testing, it works at first. If I add 5 stacks, it will subtract 5 health at the 3 second mark. But the 6th and 7th bullets that collide will do damage immediately. It's as if the 3 second wait from the 4th and 5th shots is still counting and causing the second bomb to detonate earlier.

    I need some kind of condition or set up that will only allow it to detonate at the 3 second mark and only at the 3 second mark.

  • In writing my reply, I found the solution.

    Adding a condition "every 3 second" solved the problem.

  • Glad you solved the problem yourself. You can also experiment with 'For each' loop for the bullet and observe the result.

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