Set Keyboard Direction To Player Angle

0 favourites
  • 3 posts
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • 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;

    <img src="http://s16.postimg.org/rezwjjx51/Player_Movement.png" border="0" />

    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? <img src="smileys/smiley1.gif" border="0" align="middle" />

    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.

  • why do you have that second line in everything

    and why not set it to default controls and delete all that stuff

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • why do you have that second line in everything

    and why not set it to default controls and delete all that stuff

    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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)