Traps disapear after escape

0 favourites
  • 4 posts
From the Asset Store
Escape the jet fighter and survive as long as you can!
  • I'm working on a simple game were you have to gather certain objects as fast as possible and reach exit, Time taken minus's Score.

    I randomly place an invisible trap underneath each object to be gathered. if you take to long on trap it will cancel your controls and you FAIL. If u are fast enough you can get the object and trap closes behind you, Not on you.

    1. the trap is a simple animation, with another oject that spawns on time to simulate it closing from above view on player.

    2. the problem is that after it, the trap becomes visible and spawns the traps top. the top part, stays visible as well as the trap image underneath.

    3. I want the traps to work individually not as a whole.

    4. If you go up to trap after its visible it replays animation

    5. If I could just stop the animation from replaying on collision I think it would be fine.

    any thoughts

    <img src="smileys/smiley1.gif" border="0" align="middle" />

  • There are a number of ways you could approach this. Here's an example of one way to do it.


    A boolean instance variable called "Tripped" on the trap determines whether the trap top is created and dropped.

    If the player collides with the trap when Tripped is False, then the trap is triggered (that is, the trap top is created and set in motion.) The Tripped instance variable is set to True.

    If the player is overlapping the trap top when it lands (collides with the trap), the trap top generates some solid walls that trap the player. Otherwise the trap top is moved to a lower layer so that from then on the player can move in front of it.

    As demonstrated in the example, this works with multiple traps, since each has its own Tripped instance variable, and the player collision automatically selects the trap to to test.

    I didn't show what happens when the player escapes. I would just destroy the trap walls and move the trap top to the lower layer.

    Hope this helps.

  • Wow Thx Alot the Power of True and False Prevails. I was a little sketchy about Construct 2's Booleans T/F Functions. But now I'm set. I wouldn't of been able to create my level mod in Crysis if not for Boolean function, it's soo very widely used and yet so simple in theory.

    Flowgraph I created in Cryengine2 For Crysis, Enable's NPC follow functions. It wouldn't ever work without true and false.

    Anyhow thx alot this will help alot. ez

    p.s Imagine the Construct 2 team, TEAMed Up with Crytek OMG.

    the Power of Cryteks tools combined with the ease of Construct 2s tools

    I can always imagine.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You're welcome! It was fun to do. I had a few minutes to do an escape variation. Press X when the player is trapped and the trap flips open. Most of the logic was to handle making flowers pickable if the player is in the same cage with them, or if the cage is opened.

    There is a problem I noticed when the player is almost trapped when the trap falls, but not enough to be trapped by the walls. The solid walls are still enabled so the player can't walk in front of the cage. Other than that,it basically works.


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