Traps disapear after escape

Get help using Construct 2

Post » Tue Mar 13, 2012 6:43 pm

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



B
27
S
11
G
1
Posts: 246
Reputation: 5,048

Post » Wed Mar 14, 2012 1:45 am

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

TrapExample.capx

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.kittiewan2012-03-14 01:49:15
B
29
S
11
G
12
Posts: 281
Reputation: 11,888

Post » Wed Mar 14, 2012 2:39 am

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.

http://www.crydev.net/viewtopic.php?f=319&t=79623&p=882133#p882133

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.Erndog2k2012-03-14 02:42:24
B
27
S
11
G
1
Posts: 246
Reputation: 5,048

Post » Wed Mar 14, 2012 3:22 am

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.

TrapEscape.capx
B
29
S
11
G
12
Posts: 281
Reputation: 11,888


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests