How do I move and attack at the same time

0 favourites
  • 5 posts
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • Hi there,

    Im new here and the problem is when i stand still and a press enter it attacks , but when i move (run) while press enter it wont do nothing, and with and extra sub event it disturb my running animations and idle animation.

    (meaning now for the moment its oke , when i run its running animation , and when i stand still the idle animation works fine, and if i press enter its attacks and go back to idle so great so far ,but when i want to attack while running , i do new sub event ........ and its all mest up.

    Please help out a new noob

    cheers from Belgium

    i would post a print screen but i dont now how to put it here :-s somebody help please

  • Hey

    You could make another animation... a running/attacking animation...

    Or you could make the arm a separate sprite. Then Pin it to the player, and have animations for it. (like running, or attacking)

    In this method you could have the arm doing anything while the body is still running.

  • Do you pin your animations to a controller sprite?

    You can avoid many animation issues by using a controller sprite object. Simply make a sprite that has your "characters" collision bounds (ie scaled to character sprite size with appropriate collision bounds) and then set it to invisible. Give your character that is animating a pin behavior and simply pin it to the "controller" sprite when it's spawned. The controller spite would get all the stuff you would put on your player.. instance variables, movement behavior, physics.. etc. and the animations would just be pinned to its location and not actually interacting with anything.

    In your example you could then pin other invisible sprites to the controller for sword collisions and such and match them to animations...

  • Make a separate attack animation and assign it to a different button. so if running is the right arrow down make the spacebar call your attack animation. Or if the running button and the spacebar are down at the same time attack. You could even do if the player is within a certain distance of the enemy you can call your attack animation.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • many thanks for the reply's

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