How to map movement to mouse?

Get help using Construct 2

Post » Sun Dec 25, 2011 1:43 am

Hello! Very nice program. but I can't find how to do this.

My idea is to make the game character to move according to the mouse x direction, no need for Y.

This is a test I made for flash, I want to do exactly the same with Construct:

Game made in Flashlonrot2011-12-25 01:44:38
B
4
G
1
Posts: 53
Reputation: 708

Post » Sun Dec 25, 2011 2:23 am

you use an expression. in events, create system event "every tick." then add the "set x" action for the character and for the x input "mouse.x"

mouse.x is the x value of the mouse
every tick makes everything smooth

edit: here's an example capx:exampleayzhong2011-12-25 02:30:15
B
29
S
5
G
6
Posts: 58
Reputation: 5,121

Post » Sun Dec 25, 2011 3:07 am

Thanks azyzhong! How did you add/import the mouse event?
I get this message: 'mouse' is not an object name.
B
4
G
1
Posts: 53
Reputation: 708

Post » Sun Dec 25, 2011 3:52 am

Found it, I had to insert a new (mouse) object in the Layout panel.
B
4
G
1
Posts: 53
Reputation: 708


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], kamens503 and 26 guests