Moving walls

Get help using Construct 2

Post » Wed May 08, 2013 8:21 pm

So I have a hallway that I would like to be able to send walls down. Each wall would be different.

so this situation is something like

------------------------------------------------
                        <-|        <-|
           <-|          <-|
           <-|                     <-|
------------------------------------------------

I want the walls to keep moving until they hit the end of the corridor then they will be destroyed. The player will be trying to jump/duck to avoid being pushed down the hallway.

What would be a good way to set this up? Spawn each block individually and give it a velocity and set up an event where when it touches the back wall it is destroyed? Seems like this would be a huge hassle.

Anyone have a better solution?
B
5
S
1
G
1
Posts: 28
Reputation: 615

Post » Wed May 08, 2013 8:31 pm

Don't think of the walls as walls.

Think of them as Bullets and use the bullet behavior on them.
B
13
S
4
G
3
Posts: 75
Reputation: 3,425

Post » Wed May 08, 2013 8:32 pm

Yup, give them the bullet behavior set the speed.
You can put up a sprite wall and just set it to invisible, then check for the collision to that as well.
B
94
S
29
G
11
Posts: 1,545
Reputation: 20,993

Post » Wed May 08, 2013 8:35 pm

Bullet behavior like RangerJim and ArcadEd suggested.

Or do
[code]+For Each MovingWall
-> Set MovingWall.X = MovingWall.X - (pixels per second) * dt

+MovingWall On Collision With SolidObject
-> Destroy MovingWall[/code]

That doesn't use any behaviors. There are also plenty of other ways to do it, up to you naturally. That's the beautiful thing about Construct 2. So many ways to do so many things.TL222013-05-08 20:36:35
B
58
S
20
G
7
Posts: 305
Reputation: 8,804

Post » Wed May 08, 2013 9:08 pm

I think the bullet behavior will work great! Thanks guys!
B
5
S
1
G
1
Posts: 28
Reputation: 615


Return to How do I....?

Who is online

Users browsing this forum: onzephyr and 0 guests