How do I make a dash move to my player ?

Get help using Construct 2

Post » Sun Jan 17, 2016 5:34 pm

I am working on a side scrolling platformer and I want the player to perform a dash move when I press the spacebar. In other words, I want the player to move very quick for a certain distance to the right or left. I searched the forum but I found nothing that helps me.
I tried this but is not working:

Keyboard On Space pressed
(subevent) PlayerSprite is not mirrored: PlayerBox set Platform Disabled
PlayerBox set 8Direction Enabled
PlayerBox Simulate 8Direction pressing Right (maxspeed: 1000)
System wait 1 sec
PlayerBox set 8Direction Disabled
PlayerBox set Platform Enabled

(subevent) PlayerSprite is mirrored: -----------

I tried the "(Platform) Set vector X" , not working.

ps: I am using the platform behavior for the player, I added the 8 direction just to try it.

Anyone made this before ? How can I make this to work ?
B
43
S
10
G
9
Posts: 215
Reputation: 7,142

Post » Sun Jan 17, 2016 6:58 pm

Have you tried doing that with the Platform behavior?

Image

Set the speed and acceleration up, wait 0.5 seconds and set them back to normal?
B
243
S
63
G
33
Posts: 903
Reputation: 40,791

Post » Sun Jan 17, 2016 9:30 pm

Yes, doesn't work :(
B
43
S
10
G
9
Posts: 215
Reputation: 7,142

Post » Sun Jan 17, 2016 10:57 pm

I'm not sure why that example wouldn't work but you could try adding a dash variable that is turned on when spacebar is pressed.

if dash = true => set speed to (whatever speed you feel is good); wait 0.5 seconds set dash to false
if dash = false => set speed to (whatever your normal speed is)
B
71
S
41
G
24
Posts: 358
Reputation: 18,468

Post » Mon Jan 18, 2016 7:57 am

Simply use 'set vector x'
ImageImage
B
119
S
52
G
24
Posts: 791
Reputation: 23,719

Post » Mon Jan 18, 2016 4:55 pm

It kind of works but not like I want and is buggy. I want the player to move a certain distance in the direction is facing (mirrored / not mirrored) without being necessary to hold the A or D key, just by pressing SPACE.

Can you guys please look into the .capx file ?
Link https://www.dropbox.com/s/8xf94t6jqmo2k ... .capx?dl=0
B
43
S
10
G
9
Posts: 215
Reputation: 7,142

Post » Mon Jan 18, 2016 10:32 pm

Hey there, here you go!

https://www.dropbox.com/s/08v67pz22ef2l ... .capx?dl=0

BTW I love your artwork.
B
71
S
41
G
24
Posts: 358
Reputation: 18,468

Post » Tue Jan 19, 2016 6:01 pm

Thank you so much @ultrafop !
B
43
S
10
G
9
Posts: 215
Reputation: 7,142

Post » Tue Jan 19, 2016 10:54 pm

Sure thing ;). More than welcome.
B
71
S
41
G
24
Posts: 358
Reputation: 18,468


Return to How do I....?

Who is online

Users browsing this forum: tasukilee and 19 guests