basic animation problem

  • https://www.dropbox.com/s/wtpvwo647ldm7u9/project.capx

    my animations are all messed up, when i use for example, "left" i indeed go left and i use the animation i want, but if i press "left" and simultaniously use the other keys the other animations trigger, isnt there a way where i can only use 1 at the time? for example if im holding left and press the other keys only left animation is shown

  • I'm sure there are a hundred ways to solve this, but here's what I've done in the past:

    Map out all the key presses you want to support: assign them an integer called KeyPress or whatever. So left is 1, up-left is 2, up is 3 and so on, all the way around the compass points. Include 0 for no key presses. Be sure to explicitly define the key presses including what keys should not be pressed. So if up is pressed, then down should not be pressed, and so on. Then create your motion and animations based on the KeyPress integer: If 1, then set the left animation and simulate movement left, etc.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I made one example using variable. It's pretty dirty but it works. If you want cleaner look, use GeometriX's idea

    Oh, almost forgot the file

  • it works but it takes way too much time to change animatiions, it takes 1 / 2 seconds to change animations, why?

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