Delay 2 "collision" events on the object

0 favourites
  • 4 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • // Sory 4 bad engliish

    I'm trying to make a "brick breaking" games, and I'm facing some balls breaker problem.

    What i want to do :

    In order to break one particular type of brick, the player must make the ball collide with it twice in 4 secondes.

    So the ball collide with the brick, and then he has 4 secondes to make the ball collide with it a seconde time to kill it.

    What i tried :

    <img src="http://i.imgur.com/7sdZAP0.jpg" border="0" />

    I know it seems too complex for what I try to do but I tried a lot of simpler options and this one is the only one that seems to work half the time.

    The problem :

    Half the time, the brick die on the first hit.

    I don't get it, and i think a could use a fresh look on what i've done.

  • time expression - counts from the begining of your game, not when event triggers

    You need to make a custom timer for that brick.

    Make an instance variable for that brick called "timer" and set it to 4

    When your ball hit this brick for first time, set timer to subtract 1*dt and then check if another hits are within timer limit - between 0 and 4.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The block should have an instance variable ... let's call it NumOfCol

    On Collision with block | Add 1 to NumOfCol

    If NumofCol = 2 | block : destroy

    Every 4 seconds | Set NumofCol to 0

    Cheers

  • Thanks you, both of you helped me figured out the solution :) have a nice day.

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