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
35
S
9
G
9
Posts: 206
Reputation: 6,803

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
226
S
60
G
33
Posts: 902
Reputation: 39,955

Post » Sun Jan 17, 2016 9:30 pm

Yes, doesn't work :(
B
35
S
9
G
9
Posts: 206
Reputation: 6,803

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
54
S
32
G
23
Posts: 333
Reputation: 16,591

Post » Mon Jan 18, 2016 7:57 am

Simply use 'set vector x'
ImageImage
B
101
S
45
G
22
Posts: 772
Reputation: 21,468

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
35
S
9
G
9
Posts: 206
Reputation: 6,803

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
54
S
32
G
23
Posts: 333
Reputation: 16,591

Post » Tue Jan 19, 2016 6:01 pm

Thank you so much @ultrafop !
B
35
S
9
G
9
Posts: 206
Reputation: 6,803

Post » Tue Jan 19, 2016 10:54 pm

Sure thing ;). More than welcome.
B
54
S
32
G
23
Posts: 333
Reputation: 16,591


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests