How do i stop animation from looping....

Get help using Construct 2

Post » Mon Mar 31, 2014 7:22 pm

... even though the animation loop is set to "no" on the animation window.

Hi all :)

Basically, Im using an invisible circle as a collision detection in which when activated, a snake will rise up to block your path. The detection works but the animation loops which means you can just get past the snake. This is even though the loop is set to "no" in the animation window as stated above.

Any suggestions?
Many thanks,
moymoymoy
B
11
S
2
G
1
Posts: 62
Reputation: 1,410

Post » Mon Mar 31, 2014 7:42 pm

1. Can you throw in a small capx? That will help us debug for you.

2. It could be because your collision code is running again and again, which will make the animation loop.

3. Or you have your start animation action in a place where it is called again and again.
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Mon Mar 31, 2014 8:51 pm

https://www.dropbox.com/s/qenjzyemrjfjojg/code.png
Here is the only part in the whole event sheet where the snake is called.


Appreciate the help :)
B
11
S
2
G
1
Posts: 62
Reputation: 1,410

Post » Mon Mar 31, 2014 8:58 pm

It's being called every frame(tick), add another event to your conditions, "Trigger once"
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Mon Mar 31, 2014 8:59 pm

Ahh that makes sense. Which event are you suggesting i add that too? Or do you mean a whole new event?
B
11
S
2
G
1
Posts: 62
Reputation: 1,410

Post » Mon Mar 31, 2014 11:20 pm

In every event that the condition is being called on every tick (like the "is overlapping" that you have).
Also, in your photo the first event (37, or 87, I don't really make it out the image is cropped) you have a very strange condition, basically you are checking if the Player is overlapping and not overlapping Snake_Block at the same time!
My guess is that since Construct reads events from top to bottom, the first part (is overlapping) is being replaced immediately from the second part (is not overlapping).
composer - multimedia artist
www.eli0s.com/en/
B
68
S
26
G
4
Posts: 1,146
Reputation: 9,649

Post » Thu Apr 03, 2014 6:24 pm

@ eli0s
The first event there has 2 conditions - 1 to check if the player is in a circle which makes the snake aware of the player, 2 to check if the player is NOT the circle that makes the snake block the player. So it is two collision circles, a smaller one inside a larger one. Depending on if the player is overlapping 0, 1, or 2 of the circles will then run 1 of 3 animations.

I managed to get it working though, thanks very much all :)
B
11
S
2
G
1
Posts: 62
Reputation: 1,410

Post » Thu Apr 03, 2014 8:02 pm

@moymoymoy

You are right, I saw the icons and I only read partially the names so I wrongly concluded that these are the same sprites and that the conditions cancel each-other... :shock:

Anyway, I am glad you made it work ;)
composer - multimedia artist
www.eli0s.com/en/
B
68
S
26
G
4
Posts: 1,146
Reputation: 9,649


Return to How do I....?

Who is online

Users browsing this forum: mikehive, plinkie, Yahoo [Bot] and 10 guests