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
46
S
11
G
10
Posts: 237
Reputation: 7,877

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?
Last edited by Paradox on Mon Mar 26, 2018 4:10 pm, edited 1 time in total.
B
255
S
65
G
34
Posts: 907
Reputation: 41,611

Post » Sun Jan 17, 2016 9:30 pm

Yes, doesn't work :(
B
46
S
11
G
10
Posts: 237
Reputation: 7,877

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
80
S
48
G
31
Posts: 426
Reputation: 23,027

Post » Mon Jan 18, 2016 7:57 am

Simply use 'set vector x'
ImageImage
B
134
S
55
G
24
Posts: 803
Reputation: 24,439

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
46
S
11
G
10
Posts: 237
Reputation: 7,877

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
80
S
48
G
31
Posts: 426
Reputation: 23,027

Post » Tue Jan 19, 2016 6:01 pm

Thank you so much @ultrafop !
B
46
S
11
G
10
Posts: 237
Reputation: 7,877

Post » Tue Jan 19, 2016 10:54 pm

Sure thing ;). More than welcome.
B
80
S
48
G
31
Posts: 426
Reputation: 23,027

Post » Mon Mar 26, 2018 1:00 pm

Message: Gutogordo can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
You can add a bullet behavior for your 8 directional, set it enabled and ignore user input, then disable it and stop ignoring user input, in the case of plataformers you can have a global variable called "angle" that everytime the character is mirrored is set to 180, if its not set it to 0 and set the bulet behavior angle of motion to that variable.

here is a capx that i was testing some mechanics on it, look for when the keyboard presses down:
https://drive.google.com/open?id=1k_foB ... 0ES8VKW4Sb
B
5
Posts: 4
Reputation: 239


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests