How do I make a dash move to my player ?

0 favourites
  • 10 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • 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 ?

  • Have you tried doing that with the Platform behavior?

    Set the speed and acceleration up, wait 0.5 seconds and set them back to normal?

  • Yes, doesn't work

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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)

  • Simply use 'set vector x'

  • 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

  • Hey there, here you go!

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

    BTW I love your artwork.

  • Thank you so much ultrafop !

  • Sure thing . More than welcome.

  • 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:

    drive.google.com/open ... 0ES8VKW4Sb

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)