change 8 directions by Letters A,S,D,W,X...?

0 favourites
  • 14 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Please, Im in "Beginner's guide to Construct 2 example and I need to know how to change the 8 directions in my "Player" by keyboard of letters "A,S,D,W,X..."?

    thanks muchas gracias

    I speak spanish sorry

    Gustavo

    :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Easy, make a new event about player pressing say for instance 'W' than make an action that simulates 8Direction up (or which key you would like to simulate). There might be another way but I haven't even looked for it, there might be something in the tutorial section.

  • Sorry but I dont undersdant, I go to "Event Sheet 1", after I clicked in "Add event" and after choose "Keyboard" and the condition "Key is down"? the letter "W", but in "Add Action", in "Player" I cant see "8Direction up", I only see in the section 8Direction: Reverse, set deceleration, set ignoring input, etc...

    please help me step by step Im really new.

  • Have you tried changing the 'Default Controls' property of the behavior to 'No', then you could add an event such as:

    Keyboard Right Arrow is Down - Simulate 8-Direction Right.

    You can use any key you wish for the direction this way.

  • Zenox98 ok now my default controls is "No" but I lost when you say Keyboard Righ arrow is down...

    well I go to event and add new event called Keyboard then I go to "Key is down" and then I put for example the letter "W" and I have it: Keyboard - W is down - "Add action".

    but I dont no what put in add action?.

    sorry my bad english! would you help me? please let me step by step.

    Thanks

  • action - Sprite - Platform (browse the list, these actions have different icon) - Simulate control, and then in the dropdown select the correct control (either right, left or jump).

    There are examples of platformers in your install of c2, folder examples. (or from the start page "Browse all examples")

  • now its work thanks kyatric, oh sorry but this dropdown I cant see up and down, I only see right, left and jump.

  • My bad, instead of platform, since it is a 8 direction behavior, it is in

    Sprite - 8 directions - simulate control. (the same thing, different behavior, you started with 8 dir, keep with it, delete the platform behavior, you don't need it)

  • Thanks Jyatric, but I did different see how I did:

    in events:

    Keyboard - S is down - Player - Set position to (player.x, Player.Y+3)

                          Player - Set angle to 90 degrees

    similar with the others letters...

    Thanks a lot!

    Gracias

  • It seems to me that your method would set angle to 90? everytime you hit S. What happens when you hit S repeatedly? It's really a simple thing to do, all you have to do is look. I'll give you a step-by-step when I get home tonight, but just take a look through all the actions anyways to get yourself more familiar with the engine. It will really help you out a lot. Also try using all the actions to see what they do and you should be able to come up with solutions to problems much more complex than this :)

    <font color=red>*EDIT*

    Okay here is what you have to do:

    Create a new event -> Keyboard -> On key pressed -> Where it says <click to choose> click it -> Press W -> Press OK -> Press Done

    Create an action -> On the very top it says 8Direction, click Simulate control which is in that section -> Where it says control, choose Up.

    Voila you now have W control your Up arrow movement. Do that with the rest of the keys and you should be set. I hope this helps you.

    */EDIT*</font>

  • Kiasta!! THANKS by the step by step!but I have a question. all is ok but when I stay in:

    Create an action -> On the very top it says 8Direction.... (I cant see 8Direction I only see System, bullet, Explosion, Fuerza2, Mouse, Monster, PLayer, text, texbox and Tiledbackground. But I cant see 8Direction :(

    O I forget say I have for this moment a trial version my error is for not have buy a licence?

    You are a good person for help and have patiente :)

    Gracias

  • 8direction is a behavior belonging to one of the objects.

    So in the expression/action windows you first have to select the object with the behavior, and then you'll be able to access the actions of the behavior itself.

    Licensed or not, it works the same.

  • Oh thanks Kyatric now work very fine!. but only one aclaration is:

    Kiasta say: Create a new event -> Keyboard -> On key pressed ->

    but it dont work

    I change by:

    Create a new event -> Keyboard -> key is down ->

    thank you Kiasta and Kyatric!

  • Yeah I meant while key is down, sorry about that.

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