breakout game help

Get help using Construct 2

Post » Sun Jan 12, 2014 1:54 am

So I made the platform that the ball bounces off, follow the mouse. But it goes through the wall when I move it all the way to the left or right. How can I make the platform stop when it hits the solid wall?

Fyi: the platform is a solid too.
B
10
S
4
G
1
Posts: 159
Reputation: 1,933

Post » Sun Jan 12, 2014 2:11 am

if you are using an event like:

Every tick: set platform.X to mouse.X

do instead:

Every tick: set platform.X to clamp(mouse.X, lowestX, highestX), where lowestX is the lowest value of the X position of the platform you want, and highestX the highest
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093


Return to How do I....?

Who is online

Users browsing this forum: el3um4s, TylerJS and 10 guests