How do I stop an object from moving?

Get help using Construct 2

Post » Fri Jul 04, 2014 2:34 pm

I am making a breakout game,and need to stop the paddle when it touches walls,i thought this would be very simple,but i can't figure out how to do it...another thing,i can not use bound to layout,because layout is larger.So i need another solution.
B
5
Posts: 24
Reputation: 280

Post » Fri Jul 04, 2014 2:55 pm

You can add invisible wall on left and right side with solid behaviour or the wall you said set behaviour to solid
B
257
S
43
G
15
Posts: 1,992
Reputation: 41,535

Post » Fri Jul 04, 2014 8:06 pm

Lordshiva1948 wrote:You can add invisible wall on left and right side with solid behaviour or the wall you said set behaviour to solid


It is a solid....and the paddle still goes trough it.
B
5
Posts: 24
Reputation: 280

Post » Fri Jul 04, 2014 10:14 pm

Just use clamp()

clamp(x, lower, upper)
Return lower if x is less than lower, upper if x is greater than upper, else return x.
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Fri Jul 04, 2014 11:19 pm

granpa wrote:Just use clamp()

clamp(x, lower, upper)
Return lower if x is less than lower, upper if x is greater than upper, else return x.


I don't know how to do that...i am beginner,do i do it in event sheet? If so,how?
B
5
Posts: 24
Reputation: 280

Post » Fri Jul 04, 2014 11:49 pm

Lets say you are controlling the paddle with the mouse and the furthest the paddle can go to the left without hitting the wall is 40 and the furthest right is 500,,,,,,,,
make a condition and action as follows :
System>everytick..........Paddle >set x to clamp(mousex,40,500)
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Sat Jul 05, 2014 12:41 am

granpa wrote:Lets say you are controlling the paddle with the mouse and the furthest the paddle can go to the left without hitting the wall is 40 and the furthest right is 500,,,,,,,,
make a condition and action as follows :
System>everytick..........Paddle >set x to clamp(mousex,40,500)


Thanks :)
B
5
Posts: 24
Reputation: 280


Return to How do I....?

Who is online

Users browsing this forum: MadSpy, Seruza and 29 guests