Ensuring an enemy dies when a chameleon tongue animation is fully extended?
zackperkins
Member, PRO Posts: 11
I am currently developing a game with a Chameleon.....I have created a png animation sequence (from Toon Boom) for the tongue to shoot out. There are 6 images. When the image spawns, the shooting tongue animation is only as long or short as the first image you spawn. When and the animation starts, the enemy (mosquito) hits the the clear image box and dies before the tongue animation is fully extended?? How do I ensure the enemy dies when the tongue is fully extended?
Thanks, Zack
Thanks, Zack
Best Answers
-
Socks London, UK.Posts: 12,822@zackperkins
When your tongue animation extends rather than use the actual actor (the animation is on) to detect the collision with the mosquito - have a second (invisible) actor to do the collision detection, this could be something as simple as a rectangle that you scale its length up and down to match the tongue extension.
If it's only the tip of the tongue that is dangerous to mosquitos then it could even be a small circle (again invisible) that tracks the tip of the tongue. -
Socks London, UK.Posts: 12,822
Thanks so much socks (I am programming and developing)....
Another first class amphibology joke wasted.That's a great idea....I've been experimenting with timing as Thomas said above....works pretty good. How do you get that small circle to track the animation (tongue extension)?
Track it manually, as the tongue extends have an actor move along the length of the tongue.
Answers
- Thomas
- Thomas
- Thomas
Thanks Socks- that's funny....I totally missed it (forest through the trees...). Hopefully the Chameleon will help me in the future! LOL. I will give the manual tracking a try when I figure it out- thanks!
Run your animation.
In rule:
If image = "NameOfLastImage"
Action
done!
http://forums.gamesalad.com/discussion/5716/ive-really-been-stumped-by-this-lack-of-feature
http://forums.gamesalad.com/discussion/32201/elasticrubber-effect
Here's a quick moving actor: (click on the square)
http://www.mediafire.com/?u0u2r804d6dcr9u
Imagine this is invisible and moves at the same rate and to the same distance/angle as the tip of your animated tongue.
edit in expression editor using quotes and no file extension
I was simply demonstrating how you go about changing an attribute when the actor image name is equal to a specified image name.
So now you know how to change an attribute when your animation gets to a certain image. The next step is to use that attribute in conjunction with the collision rule you're already using to destroy the actor.