Breakout - How can I make the pad not go through the walls?

0 favourites
  • 6 posts
  • Hi,

    I'm trying to make a Breakout-type game, and followed a tutorial I found here. I've also searched for issues and solved some, but one thing remains a mystery to me: When I use the pad (by letting it follow them mouse's X-coordinates), it doesn't stop when hitting one of the walls on the side of the playing-area. Let's say the playing-area is a box in the middle of the screen, covering about a third of the screen. I want the pad to stay in there, and not go all the way over to the edge of the screen.

    Thanks for any help.

  • this probably isn't the best solution, but if it was me I'd probably create an invisible sprite with a solid behavior at the edge of each line you don't want the pad cross, & then enable collisions so the pad just sorta bumps into the sprite

  • Thanks, but I can't get that to work either. I have a wall-sprite on each side, and both the pad and wall are set to solid. I've tried enabling collisions, but it's not working. I then set the pad's X-coordinates to the wall and the pad, but neither work. I'm running out of ideas here. Surely someone else has made a Breakout-style game in Construct? How did they solve this issue?

  • Right click on your sprite.

    Select Behaviors.

    Select Bound to Layout.

    Press Okay.

    Come back here and say thanks!

  • Thanks, that worked.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • lol thanks

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