[8-direction] Different speeds for different directions ?

Just started using Construct 2? Post your questions here

Post » Sat May 28, 2016 7:12 pm

Is it possible to set different speeds for different directions on 8-direction? Think of games like Streets of Rage and Final Fight. The player character moves faster sideways than up and down.
B
21
S
7
G
4
Posts: 233
Reputation: 3,474

Post » Sat May 28, 2016 7:13 pm

You can try to set speed movement for each control, everytime the player moves.

If you press the key to move up, you set the speed and simulate control Up. And same for the other directions (with different speeds).
B
19
S
6
G
2
Posts: 256
Reputation: 2,640

Post » Sat May 28, 2016 7:20 pm

That wouldn't work when, for example, player moves down right. They would then move either slowly forwards or too fast downwards.
B
21
S
7
G
4
Posts: 233
Reputation: 3,474

Post » Sat May 28, 2016 7:36 pm

NVM, fixed it! I simply set the Y vector to "sprite.8Direction.MaxSpeed/2". Sure it doesn't have accleration, but I didn't want that anyways so it works just as I wanted. And to make it move upwards I just divided the Y vector by -1.
B
21
S
7
G
4
Posts: 233
Reputation: 3,474

Post » Sat May 28, 2016 8:00 pm

Hasuak wrote:NVM, fixed it! I simply set the Y vector to "sprite.8Direction.MaxSpeed/2". Sure it doesn't have accleration, but I didn't want that anyways so it works just as I wanted. And to make it move upwards I just divided the Y vector by -1.


Srry i didn't really understand you question before hahahah Nice job
B
19
S
6
G
2
Posts: 256
Reputation: 2,640

Post » Sun May 29, 2016 8:40 pm

What you might try is giving your player two copies of the 8-direction behavior. Set one to only left and right motion and the other to only up and down.
Eh, Steve!
B
113
S
54
G
13
Posts: 112
Reputation: 16,095


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests