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

Get help using Construct 2

Post » Thu Feb 20, 2014 3:19 am

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. :)
B
5
S
1
Posts: 43
Reputation: 655

Post » Thu Feb 20, 2014 4:15 am

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
B
16
S
5
G
4
Posts: 106
Reputation: 2,450

Post » Thu Feb 20, 2014 4:41 am

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?
B
5
S
1
Posts: 43
Reputation: 655

Post » Thu Feb 20, 2014 4:47 am

Right click on your sprite.
Select Behaviors.
Select Bound to Layout.
Press Okay.

Come back here and say thanks!
B
56
S
15
G
13
Posts: 826
Reputation: 17,705

Post » Thu Feb 20, 2014 6:09 am

Thanks, that worked. :D
B
5
S
1
Posts: 43
Reputation: 655

Post » Thu Feb 20, 2014 11:42 pm

lol thanks
B
16
S
5
G
4
Posts: 106
Reputation: 2,450


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 22 guests