How do I change the speed of sprite movement?

Get help using Construct 2

Post » Tue Jul 14, 2015 11:11 pm

hi everyone. how can i change the speed of sprite that move w a s d movement? (i want to make dash action for my game character)
for example: if i will press W+space - the character will dash right.

this is how I did the movement:

conditon: key press - W action set Y to player.Y-2

conditon: key press - S action set Y to player.Y+2

conditon: key press - D action set X to player.X+2

conditon: key press - A action set Y to player.Y-2
B
8
S
3
Posts: 100
Reputation: 1,023

Post » Tue Jul 14, 2015 11:14 pm

You can add another condition that Space is being held down and then just double the movement.

Any reason why you aren't using 8 Direction Behavior?
B
11
S
2
G
1
Posts: 79
Reputation: 842

Post » Wed Jul 15, 2015 9:23 am

Instead of having a fixed "2", use a global variable the value of you can modify.
Also you should perhaps look at behaviors since they are framerate independent or at least make your own code framerate independent.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
291
S
114
G
95
Posts: 7,290
Reputation: 70,138

Post » Wed Jul 15, 2015 5:54 pm

ThomasP wrote:You can add another condition that Space is being held down and then just double the movement.

Any reason why you aren't using 8 Direction Behavior?


thanks :)
B
8
S
3
Posts: 100
Reputation: 1,023

Post » Wed Jul 15, 2015 5:54 pm

Kyatric wrote:Instead of having a fixed "2", use a global variable the value of you can modify.
Also you should perhaps look at or at least make your own code framerate independent.


thanks :)
B
8
S
3
Posts: 100
Reputation: 1,023


Return to How do I....?

Who is online

Users browsing this forum: dop2000, uzumiapps and 29 guests