Changing a enemy animation based on its direction

Get help using Construct 2

Post » Sat Jul 27, 2013 2:35 am

Currently I'm using a global variable which the system randomly changes every few seconds, and the enemy units move in a specific direction based on this variable.

This all works fine, but I can't seem to get the proper animation to play based on the direction my enemy is traveling.

Currently he'll still face right and move up, and then his animations will stop changing completely. After looking at countless tutorials and other help topics on the forums I've just about exhausted all ideas I have.

Does anyone know of any good tutorials, lessons or have a capx with a enemy unit and properly changing animations? I'm having a huge issue here.

Thanks guys!
B
4
Posts: 78
Reputation: 606

Post » Sat Jul 27, 2013 4:02 am

Could you post an example of your capx so we have a better idea of what you've done and how to help you?
B
12
S
3
G
3
Posts: 36
Reputation: 3,048

Post » Sat Jul 27, 2013 5:52 am

Hey, sorry about that, I knew I was forgetting something.

The Capx is rather large and a bit much to go through.

But the only part containing any enemy movement currently is below:




B
4
Posts: 78
Reputation: 606

Post » Sat Jul 27, 2013 5:53 am

I'm also trying to figure out how I can get them to move independently of eachother. Right now, obviously if I put more than one enemychewie on the screen, they all move exactly the same and I'd like them all to move in different directions independtly of one another.

Any help you can give is greatly appreciated! Thanks!
B
4
Posts: 78
Reputation: 606

Post » Sun Jul 28, 2013 3:26 pm

Try adding a 'for each' condition for the enemy chewie. That way they can all be independent. Remember if you aren't choosing any specific instance (of the chewie) in the event then it will choose all of them.

Also you probably want to change the global direction variable to an object based instance variable. So when you randomise the direction each object can store its own number and be moved accordingly.GenkiGenga2013-07-28 15:52:38
ImageImage
B
123
S
23
G
7
Posts: 1,071
Reputation: 13,091


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 34 guests