How do I dash (left)?

Get help using Construct 2

Post » Thu Sep 03, 2015 9:59 pm

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 : )
B
3
Posts: 5
Reputation: 185

Post » Fri Sep 04, 2015 2:28 am

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
B
9
S
3
Posts: 104
Reputation: 1,033

Post » Fri Sep 04, 2015 8:28 am

one way

https://goo.gl/1CwTrs

I have also added a timer (dashdelay) so the dash can only be used once every 2 seconds
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,832

Post » Fri Sep 04, 2015 9:27 pm

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
B
3
Posts: 5
Reputation: 185

Post » Sat Sep 05, 2015 7:11 am

try something like ?

https://goo.gl/z5e1U8
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,832

Post » Sat Sep 05, 2015 2:22 pm

i am looking forward to this too. can you please also share capx file too.. :)
B
5
S
1
Posts: 49
Reputation: 455

Post » Sat Sep 05, 2015 2:22 pm

i am looking forward to this too. can you please also share capx file too.. :)
B
5
S
1
Posts: 49
Reputation: 455

Post » Sat Sep 05, 2015 4:33 pm

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
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,832

Post » Wed Sep 09, 2015 7:50 pm

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?~
B
3
Posts: 5
Reputation: 185

Post » Fri Sep 11, 2015 8:48 pm

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 :)
B
3
Posts: 5
Reputation: 185

Next

Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish and 14 guests