Moving walls

  • 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?

  • Don't think of the walls as walls.

    Think of them as Bullets and use the bullet behavior on them.

  • 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.

  • Bullet behavior like RangerJim and ArcadEd suggested.

    Or do

    +For Each MovingWall
    -> Set MovingWall.X = MovingWall.X - (pixels per second) * dt
    
    +MovingWall On Collision With SolidObject
    -> Destroy MovingWall

    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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think the bullet behavior will work great! Thanks guys!

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