Set Keyboard Direction To Player Angle

Get help using Construct 2

Post » Sun Jun 16, 2013 12:37 pm

I've looked around the forums and tutorials, and can't seem to find anything on this. I've also been digging through Construct 2's various control methods, and can't seem to find anything there, either.

It may not be possible, but I want to be able to bind the up/down/left/right arrow keys relative to the player's angle, which is determed by the mouse. I want to use 8Direction style movement, and also ignore mouse input when the up/down/left/right key is still being pressed.

My current thinking is;



Which kind of works, although the main issues are;

1: I want it to ignore or delay mouse input when a key is pressed (Think I can figure this one out)
2: I want to be able to use 8Direction controls Max speed, Acceleration, and Deceleration, rather than a fixed speed.

Any ideas?

As a control method it's a bit work in progress. I'll probably end up altering it, or decide it's not really going to work. It'd probably be better off using left/right to rotate the player, and up/down to move backwards and forwards. Still, it doesn't do any harm to experiment with input.

B
3
Posts: 23
Reputation: 221

Post » Sun Jun 16, 2013 3:05 pm

why do you have that second line in everything
and why not set it to default controls and delete all that stuff
B
39
S
11
G
7
Posts: 514
Reputation: 9,601

Post » Sun Jun 16, 2013 4:18 pm

[QUOTE=sosensible] why do you have that second line in everything
and why not set it to default controls and delete all that stuff [/QUOTE]

The default controls move the player up/down/left/right in absolute terms. I want to move the player relative to which direction the player is facing.

So if the player is facing left, then "up" will move the player left. That's what the second line is for. It binds the keys to all the angles relative to whatever direction the player is facing.
Nullus2013-06-16 16:22:42
B
3
Posts: 23
Reputation: 221


Return to How do I....?

Who is online

Users browsing this forum: ilyaTyl and 13 guests