8-way directional custom controls.

0 favourites
  • 7 posts
From the Asset Store
Pathfinding AI
$2 USD
80% off
Units do not overlap each other and use different ways if there are several free ways.
  • Hello Construct Community,

    I'm a bit new to this program, so I'm a bit confused as to how to make an 8-directional movement. If any of you have played they game Rocket Knight or Sparkster, there's an 8 way jetpack movement(ie Up, Left, Down, Right, UpRight, DownLeft etc.)

    I'm trying to recreate that directional movement, but I'm not sure how to do it using custom movement. I need to be able to cancel velocity unless a button is pressed (I'm reassigning to WASD) as well. Please help.

    Also, I'm trying to have the overall speed be around 400. I'm running into an issue where the speed cancels in every direction other than the one that was pressed.

  • Why not using the 8-dir behavior ?

  • With the default controls it seems to rotate and accelerate towards a direction, but I need it so that the sprite is at a constant speed, but once a direction is pressed, it's dedicated to that direction until changed. Kind of like a light-cycle, but in 8 directions rather than 4. I've gotten it to where the WASD changes the direction of the object towards 90, 180, 270 and 360 degrees, but I need the angles halfway in between them.

    I'm sorry if my language isn't clear, as I'm sort of stumped at this point.

  • With the default controls it seems to rotate and accelerate towards a direction, but I need it so that the sprite is at a constant speed, but once a direction is pressed, it's dedicated to that direction until changed. Kind of like a light-cycle, but in 8 directions rather than 4. I've gotten it to where the WASD changes the direction of the object towards 90, 180, 270 and 360 degrees, but I need the angles halfway in between them.

    I'm sorry if my language isn't clear, as I'm sort of stumped at this point.

    So using the 8-dir behavior:

    Set the angle property to "45 degree-interval"

    Play with the values of max speed, acceleration and deceleration (you want max speed to be far inferior to acceleration)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah, you can just set the acceleration on 8Dir behaviour very very high..

    But I made this anyway if you're interested:

    8DirTron

  • Thanks guys! That really helped. I thought that 8-direction was for things that moved freely rather than having dedicated directions. I'll see how I can implement it so it's as tight as I need it.

  • Guys, I wanna ask. How do i set my custom controls? I'm fine with the 8 mov. behavior, but I want it to be on W, S, A, D keys. I know it's easy to make, but I don't know where to see ,,press button"

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