Slowing down animation?

0 favourites
  • 5 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • Hi all,

    New to the forum but been working in Construct 2 for a couple months, and I need a bit of help.

    I have an enemy that is a sock monkey that drops down from the ceiling when on screen, facing the direction of the player. If the player is within 600px of the sock monkey, the sock monkey does a little "taunt" animation (facial expression changes). Now that all works.

    The problem I have is here: If the player is within 500px of the sock monkey, the monkey's "throw" animation is supposed to play as it throws a banana towards the player every 2.22 seconds.

    The actual banana portion works fine. The problem I am having is with the animation. The sock monkey is in frame 0 of the "throw" animation when the player is within 500px, and is supposed to go to frame 1 when actually throwing a banana every 2.22 seconds (sub event). However frame 1 is only a little flicker when throwing the banana. I can see it goes to it but it is SO fast, it's just a flicker.

    How do I go about slowing down the animation so you can actually SEE the monkey's arm throwing the banana? I only have the animation speed set to 1.

    Thanks in advance!

  • We really need a tutorial on animations lol. Accidentally playing two or more animations at the same time will cause this "flicker". One animation tries to play but another one interrupts it. It has nothing to do with the speed.

    You could try giving the monkey a variable called "Attacking" or something, then do something like this..

    +Monkey.attacking = 0

    -Do normal monkey stuff

    +Every few seconds

    -Set Monkey.attacking to 1

    -Set Monkey animation to "Throw"

    +Monkey animation "Throw" has finished

    -Set Monkey.attacking to 0

    -Resume normal monkey stuff

    This way the monkey's normal routine is ignored while attacking, and nothing gets interrupted.

  • Maybe you could post your capx so we could have a look

  • Thanks for the fast responses!

    I tried using the variable, but now it seems to get stuck at the "taunt" animation, and one banana is thrown? After that nothing happens, I just see the monkey's taunt face.

    I can't post the capx as it's a game I'm working on with a team. But I can try to explain in pseudo code:

    If monkey distance to player is <= 600px and the monkey has dropped

    • Set animation to taunt
    • Set shooting to true

    If monkey distance to player is <= 500px, shooting is true, and throw = 0

    • Set animation to throw
    • Set frame to 0
    • Set throw to 1

    (sub event)

    Every 2.22 seconds and throw = 1

    • Set frame to 1
    • (Shooting banana stuff here that works)
    • Set throw to 2

    If monkey's animation throw finished and throw = 2

    • Set throw to 0
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Problem solved! Have to move out the subevent... throw can't be set to 1 and 2. :) Always simple!

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