Walk not just with arrows, also with WASD

0 favourites
  • 15 posts
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • So its a long time ago I made the walking events for my main character. Its just:

    When left arrow pressed:

    • Player set mirrored
    • Set animation "Walk" (play from beginning)

    Thats works fine. But I think it would be nice to also make the WASD movement.

    Is there a easy way to combine it with my first "arrows" movement or how can I do it?

    I already tried an extra event like this:

    When W pressed:

    • Player set mirrored
    • Set animation "Walk" (play from beginning)

    But here he just goes into the right animation but he doesnt walk...

    Best way would be something like this: When left arrow OR w pressed: ....

    Thanks guys!

  • add another condition where if you press a,s,d,w the player will move just the same as the arrows

    now you should have 2 conditions to meet if the player presses (left arrow & A key) moves left

    on the event right click to the very left of the 2 conditions and make the condition an OR condition making it (left arrow OR A key) move left

    something like this shouldn't add a lot to the events

  • Okey thats sounds nice but I have the problem that my charakter walks correct with the arrows (maybe thats default)

    but with the "A" he just sets the animation and stuff, but he doesnt move.

    • Player set mirrored
    • Set animation "Walk" (play from beginning)

    Thats my event for the arrows and it works. Is there another action that I need for the WASD buttons?

  • I think I know what is missing

    add an action like e.g.

    obj_player simulate pressing left

  • Yeah something like that but its not working :/

    Now I have it made exactly like this: On "A" pressed

    • Player set mirrored
    • Player set platform maximum speed to 400
    • Player set animation to "Walk"
    • Player simulate platform pressing left

    But its not working... ^^

  • Here I thought I made it!

    http://www.pic-upload.de/view-29840163/ ... e.png.html

    Now its working with the "left arrow" but not with the "A"! Why! ^^ Pls guys help me ^^

  • all you need to know is https://youtu.be/qfMcaCN7BaY?t=697

    Here the standard keys are deactivated (plattform behaviour)

  • You should disable default keys too when doing this.

  • emoaeden like he says disable default keys in left hand PROPERTY

  • Okey thanks guys! One last question, ist there something like a command where you could say if there comes a user input "W", make exactly the same like if he would press "Up arrow". Somethin like a pointer on my "Up arrow" event. If he press "W", make the same event as he would press the "Up arrow" ^^ If you know what I mean

  • I thought this was the whole point of your question?

    Do you mean "cursor Up" OR "W" - (hint: this is the answer)

    Please read or watch a platformer tutorial - because this is basically one of the first steps in every tutorial.

    like: https://youtu.be/8V4q6usaYMk?t=594 (but I suggest to start from the first video of this series

    Subscribe to Construct videos now

    )

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah but the problem is with "default controls" the arrow keys are not working the same as WASD. It's a bit complicated to explain and my english is not the best ^^

    I think I have to set my main characters default controls to no and add some more actions to my walk events. With the default controls you dont need a action like "simulate platform pressing left". It also works without is, but just with the arrow keys. Thats was also the problem why my OR not worked... Thanks!

  • Keyboard | Keycode 87 is down Player move forward 2 pixels W key

    Player set angle to 270 UP

    as above keycode for A = 65 and angle 180

    as above keycode for D = 68 and angle 0

    as above keycode for X = 88 and angle 90

    Thus you have 4 keys assigned W A D X

  • Nefaru If you want full demo then check it out with link below FILE NAME KEY CODES.CAPX

    https://www.dropbox.com/sh/eioscti86bpr ... 7YPza?dl=0

  • Cool Thank you

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