How to make a "chain reaction" using a timer ?

0 favourites
  • 4 posts
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • I have a boat that floats on 10 air containers. each container communicate with the one next to it, and the scenario is that if one container is flooded with water it takes 1 second for the next one do be flooded....and so on

    I use opacity=100 if the container is flooded and opacity = 50 if is empty.

    I can use opacity, different frame or animation to change the state of the container..but I want to use the same Object type.

    In my example I want to wait 1 second before flooding the next container, but I only make it flood instantly.

    Any ideas how to properly make a delay ?

    capx

  • floodanddrain.capx

    You need to keep track of which one is active for each second.

    I'm using lerp for flooding and just Every X seconds for the drain.

  • Thank you

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • blackhornet I tried to modify this for my game of pipes...but is becoming tooooo complicated and cannot figure out how to do it. The idea of the water coming through pipes is the same as for the boat...the difference is that the flooded container coming from the boats around .

    It feels more natural to me the overlapping/collision condition, but Construct don't feel the same:)

    [EDIT] I found a stupid simple solution. I put a collision polygon that when the containers are in normal position they do not collide, and when flipped they collide. I think is not the right way to do it...but it works...except the fact that I have to click inside polygon to register as a mouse click. But that don't bother me. <img src="smileys/smiley10.gif" border="0" align="middle">

    chain reaction v2

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