How do I change state of block correctly?

0 favourites
  • 2 posts
From the Asset Store
State Machine
$10.99 USD
State Machine is a great tool for managing the state of anything in your game.
  • Hello, currently I am trying to improve my knowledge of Construct 2 by writing Arcanoid/Breakout clone.

    In game I have blocks that can be destroyed after few ball hits. My usual way of implementing such blocks was destroying Block A on collision and spawning Block B at the same spot and at the same time. However I believe that while this solution works fine, it isn't a correct one.

    So instead I decided change animation frame of block on 1st hit and destroy block on 2nd hit.

    Here is my current code (ignore the angle part):

    And there I found a problem. If I change order of events then my block is destroyed after a single hit. I believe this is happening because overlapping between block and ball happening for more than a single tick and both event conditions are true for a virtually the same amount of time.

    So, my question: Is there any way to set a delay between events, so they won't happen at the same? Or add specific logic for this case?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Use 'System:Else' between the different animation frame conditions so that only one of them runs, like this:

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