Locking mouse movement to an axis

For questions about using Classic.

Post » Tue Apr 05, 2011 3:38 pm

My question is fairly simple, most people here have played breakout. Is there a way I can use the mouse for the "paddle" but only allow it to move left or right, instead of all around the screen?
B
1
G
1
Posts: 3
Reputation: 431

Post » Tue Apr 05, 2011 4:34 pm

just set the x position to mousex. Clamp the range with clamp().
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Tue Apr 05, 2011 5:13 pm

Thankyou, nice to get an answer to a question finally. Im at work right now so can't try it out, but im eager to get back and plug it in. Let you know how it works for me.
B
1
G
1
Posts: 3
Reputation: 431

Post » Tue Apr 05, 2011 5:26 pm

It's going to work, trust me. :)
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Wed Apr 06, 2011 1:00 pm

[url:3b2d7wbs]http://dl.dropbox.com/u/7658043/mouseclamp.cap[/url:3b2d7wbs]

It works like a charm.Here's an example cap.
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests