[SOLVED] Enemy AI using private variables goes crazy.

This forum is currently in read-only mode.
From the Asset Store
The ultimate voice pack filled with 1,536 files of .......wav and mp3 of individual numbers, letters, and words (that go
  • Hi Baconizer, I'm new on Construct 2, also in development of games, but I always like all that matters of build games. I was attempting to create my first game with this tool, and as usual with the rookies, have a lot of trouble to get thru, anyway, my concerns is maybe simple for you because you did on your game KatEwondo...

    I want to add an animation hitting twice the same key, example, my player run to the left pressing the left arrow key, and I want to he can slide or jump to the left hitting the same left arrow key.. Can you know any behavior or whatever action to do on Construct2?

    thanks in advance

    also sorry for my bad english, this is not my mother language either (spanish is)

  • Sorry for not posting anything earlier, I´ve been really out because of work.

    My mother language is also spanish, maybe send a private and try to help you.

    Sorry again for being late!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I did that with a simple variable.

    For example, you want to dash and stop walking if you hit left twice:

    if press Left

    {if variable "dash"=0

    {dash=30; and here put your stuff for walking}

    if variable dash>0

    {Here your stuff for dashing, like Megaman fore example}

    }

    That´s the basic routine when you press Left key, now you need COUNTDOWN for the variable name DASH the one that let you know if you hit the key or not, so go to "Every tick" and:

    if dash>0 {dash -=1;} -----> this substract 1 from "dash" and make it zero, so if you dont press Left key in that time, you wont be able to dash....

    I won´t attach a Construct 2 example here, but you can see what Ive done in my game.

    Hope that helps

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