How do I set a Left And Right Animation for a enemy

0 favourites
  • 5 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • I have this enemy that has a sine behavior and I have animations for when they go left and right. I wanna know how to set their animations For when they go left then go right. Also how would I pause a enemy To stop then continue after a few seconds.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can use Sprite.Sine.CyclePosition expression.

    For example, for horizontal movement:

    Sprite.Sine.CyclePosition is between 0.25 and 0.75 -> Sprite set animation "Left"
    Else -> Sprite set animation "Right"
    

    I also recommend LiteTween addon (instead of Sine), you can make much nicer looking movements with it. And it has events like "LiteTween on end", which you can use to pause your enemy.

  • You can use Sprite.Sine.CyclePosition expression.

    For example, for horizontal movement:

    > Sprite.Sine.CyclePosition is between 0.25 and 0.75 -> Sprite set animation "Left"
    Else -> Sprite set animation "Right"
    

    I also recommend LiteTween addon (instead of Sine), you can make much nicer looking movements with it. And it has events like "LiteTween on end", which you can use to pause your enemy.

    How would I add the addon to construct 2?

  • fur just mirroring the animation left and right based on current position of the character you can try this C2 file, the last 3 condition events are for mirroring the animation, there are no plugins needed. however you might need the plugin to move ur character automatically unless u want to code it manually also.

    And you can achieve that by giving the character u want to move in a loop a variable called moveto and set it to 1 or 2

    and that would continuously move ur wanted character left and right, combined with the animation events from the capx above it should look pretty smooth without any plugins, but then you would use some extra events that you previously saved with the plugins/behaviors.

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