How do I dash (left)?

  • Hey guys

    Nice to meet you all! I'm practicing a bit Construct these days, not really making 1 game for now, just training some ideas. I was in a platformer game, and wanted to add dash moves.

    My intuition told me to make this:

    Keyboard > Space is down > [PLAYER] Set position to (self.x+15; self.y)

    It works great!

    ... if you move forward (right). If you look on the left, you'll obviously still dash to the right, which is odd~

    Either I need to spot a mirrored position of the player and apply x-15 or I can do that directly with another expression than 'self' (something like 'direction'?). I tried a few things but can't find a solution yet to that noob issue... I also looked on the forum (edit / I can't post url yet~ ) but there is no answer + we don't use the same method (bullet speed) and I just want to use space not 2 dedicated buttons (then my problem would be fixed but it's less natural to play).

    Let me know : )

  • Duplicate this 'Keyboard > Space is down > [PLAYER] Set position to (self.x+15; self.y)'

    Add another condition to each 'A is down' and 'D is down'. Presuming you are using those for your direction buttons.

    change the x+15 to x-15 for the one moving left.

    Hope it helps

  • one way

    https://goo.gl/1CwTrs

    I have also added a timer (dashdelay) so the dash can only be used once every 2 seconds

  • Hey thanks for these answers!

    'Platform max speed' isn't really what I want because this works like a sprint/run = you still need to input direction keys (it's basically the SHIFT key in any FPS).

    I want the SPACE to trigger a dash, according to the current facing direction. That's why I started with 'Set position'. If I set space as 'pressed', it works as a teleport, which isn't what I want, if it's set as 'down', the dash works but I indeed need to put a threshold to it + find how to make it work to the left (not sure to get your point Frostein since it relies more on the side the player faces, and not if A/D are pressed).

    To be continued! Thanks

  • try something like ?

    https://goo.gl/z5e1U8

  • i am looking forward to this too. can you please also share capx file too..

  • i am looking forward to this too. can you please also share capx file too..

  • Sorry I didn't keep the capx. Everything you need is in the screen grab. add sprite and give it platform and timer behaviors (behaviours ?) and set as shown. add keyboard object and a couple of solid sprite to act as a running area. Bobs your uncle....

    I will check

  • Thanks for your new answer! It's though trickier than expected and I'm not familiar yet with everything from your screen, I'll try all this asap.

    Edit. Like where/how to set-start timers?~

  • Ok I found the (easy) part that I was missing to deal with the 2 sides.

    Now, I still need to polish the dash part (space down instead of pressed? temp platform speed + cooldown?) because it's just a teleport here.

    But at least it works in the 2 directions which was my 1st issue...

    Keyboard / On [SPACE] pressed (and I add 2 sub-events = right click on this 1st event)

    • MC (my player) / is mirrored /// MCcoll (my coll box) Set X to Self.X-150
    • MC / is not mirrored (right click > invert) /// MCcoll / Set X to Self.X+150

    To be continued

  • revisited ...

    @codeartonline & Abo

    https://goo.gl/ljKIYy

  • (Late) Interesting, thanks !

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Better late than never, as the saying goes

    Thinking about it - where I was using

    Sprite.Timer.Duration("cooldown")

    as a condition , it might be better to have used a instance variable boolean on the player (ivIsDashing ?) setting it in start of dash and using the on timer to reset it. Hope this makes sense ?

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