Animation Override?

0 favourites
  • 7 posts
From the Asset Store
4 Block Soldiers with different animations, 400x400
  • So if i'm trying to make my character have air moves, running moves, standing moves, and each have 4 different directions. (running attack, air side attack, land side attack, air up attack, land up attack etc.) Do i put sub categories under every button saying....   If (Move right) is down, and (sub-category - attack right is pressed AND character is on ground DO this) or (Sub-category - attach right is pressed AND character is in air DO This) so on so forth?

    And how do I make it so the player can't press a button to initiate another attack until the current one has finished?

    I would post my file if I knew how :(

    Thanks guys! I'm really enjoying this engine! I spent about 10 hours playing with it yesterday, i just wish there were more tutorials

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • One easy way to separate movements so that players don't interrupt them is to use some variables.

    eg: in air (0 or 1)

    on ground (0 or 1)

    currentanimation (0, 1, 2, 3)

    etc

    Then add additional conditions to each type of button press so that they only occur when your player is in the correct state.

    eg:

    Lets use an air attack as an example, you probably have a different animation for air attacks.

    pseudo code:

    on keyboard press "jump button" set "in air" variable to "1"

    on keyboard press attack (add a second condition of "In air variable is equal to 1"

    play air attack animation

    else play ground attack animation

    that way it will only play the air attack animation if the player is in the air.

    hopefully that made sense lol.

  • Yup! I understand!   Instead of using variables, i would I just use the platformer actions though right?   Like when player is moving do this if in air or this of on ground?

  • Yup you can use those conditions as well.

  • Hmmmm I have them setup like that though. :(. How do you post the file?

  • Actually a better question would be, which of these methods takes less cpu power? Adding a global variable to check for a value, or using the events?

  • As for my previous question, I found out through reading through tons of posts that it really doesn't matter which you do, the main part of the processing power comes from the animations, so go ahead and load up your events, because they don't use up most of the CPU power.

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