Changing a enemy animation based on its direction

0 favourites
  • 5 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • 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!

  • Could you post an example of your capx so we have a better idea of what you've done and how to help you?

  • 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:

    <img src="http://somethingwickedart.com/enemyCap.PNG" border="0" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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!

  • 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.

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