How do I move a certain distance on key press?

Get help using Construct 2

Post » Thu Sep 10, 2015 3:51 am

Hi everyone,

I want my character to move 50 pixels towards left and right on left/right key press.

Right now I have

On Right Arrow pressed: move 50 pixels at angle 0

However, that causes the sprite to instantly move 50 pixels as if it teleported.

How can I gradually move the character towards right and stop it after 50 pixels?

I am doing this instead of using 8 directions behaviour because I want it to moved at a set distance everytime left/right key is pressed.
B
23
S
10
G
2
Posts: 104
Reputation: 3,071

Post » Thu Sep 10, 2015 4:06 am

B
56
S
15
G
13
Posts: 826
Reputation: 17,645

Post » Thu Sep 10, 2015 4:17 am

@Tekniko

Thanks for the capx but that's not much difference from the event I am using. It still doesn't move gradually. I want something like sprite moving 5px gradually when the right key is pressed once until it reaches 50px and stop automatically .
B
23
S
10
G
2
Posts: 104
Reputation: 3,071

Post » Thu Sep 10, 2015 5:06 am

try something like::

Image
B
66
S
24
G
7
Posts: 1,514
Reputation: 11,039


Return to How do I....?

Who is online

Users browsing this forum: 25games, Artcadev, brunopalermo, MaxxMunnn, mcscooter, Soluna Software and 23 guests