Mouse and keyboard: set control state help

For questions about using Classic.

Post » Mon Mar 08, 2010 3:11 am

Hello, what exactly does the set control state of the mouse and keyboard object do? Im using the following actions with the platform behavior, but it doesn't appear to be doing anything.

Always - MouseAndKeyboard - set control of player 1 to 0
B
2
G
2
Posts: 10
Reputation: 670

Post » Mon Mar 08, 2010 5:18 am

The Mouse & Keyboard object is a very powerful set of commands that you can access though Event sheet editor. It tests for what mouse buttons were clicked, cursor moved over, key presses, etc.

Look Event sheet editor and you can see all it does.
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Mon Mar 08, 2010 8:18 am

Actually the control states are defined in preferences, down at the bottom. You can use the predefined ones like "Move Left(p1)" or define your own.
Something like:
+ MouseKeyboard: Player 1 "Move Left" is down
-> Sprite: Set X to Sprite.X+1

Would move sprite to the right instead of to the left, or how ever you want it.
Note: you can also use control states as Boolean comparisons, as either 1 or 0.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests