Slowing down animation?

Get help using Construct 2

Post » Mon Apr 02, 2012 4:09 am

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!
B
4
Posts: 5
Reputation: 310

Post » Mon Apr 02, 2012 4:16 am

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.Tokinsom2012-04-02 04:37:05
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Mon Apr 02, 2012 1:48 pm

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

B
28
S
2
Posts: 69
Reputation: 1,491

Post » Mon Apr 02, 2012 7:24 pm

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
B
4
Posts: 5
Reputation: 310

Post » Mon Apr 02, 2012 11:42 pm

Problem solved! Have to move out the subevent... throw can't be set to 1 and 2. :) Always simple!
B
4
Posts: 5
Reputation: 310


Return to How do I....?

Who is online

Users browsing this forum: WhosWho and 18 guests