8-way directional custom controls.

Get help using Construct 2

Post » Fri Mar 02, 2012 1:44 am

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. diggbladush2012-03-02 01:53:43
B
3
Posts: 8
Reputation: 516

Post » Fri Mar 02, 2012 2:51 am

Why not using the 8-dir behavior ?
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Fri Mar 02, 2012 6:52 am

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.
B
3
Posts: 8
Reputation: 516

Post » Fri Mar 02, 2012 7:39 am

[QUOTE=diggbladush] 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. [/QUOTE]

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)

New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Fri Mar 02, 2012 8:34 am

Yeah, you can just set the acceleration on 8Dir behaviour very very high..

But I made this anyway if you're interested:
8DirTron
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Sat Mar 03, 2012 1:40 am

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.
B
3
Posts: 8
Reputation: 516

Post » Wed Sep 11, 2013 11:01 am

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"
B
4
Posts: 4
Reputation: 208


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 0 guests