Sprite fire and animation

  • Hi guys,

    I work for android game.

    I have a sprite that moves with the two arrows (right and left via touch ) and a button to shoot. that's all ok , but also having an animation that changes the character of the times when shooting ( looking right ) how do I make it clear to the program " if you look left = left shot animation and if you look right = right animation ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Assuming the character is facing right, when shooting left Set Mirrored on sprite.

  • Hey there,

    So you could always use the animated sprite itself, assuming you're using the "mirrored" option to flip your sprite right and left when you move in those directions.

    Example:

    When shooting-

    --if animated sprite is mirrored = used left shoot animation

    --if animated sprite is not mirrored = use right shoot animation

    If this isn't what you've done, for simplicity's sake, you may want to try implementing it (there should be some tutorials that have information about animation and mirroring sprites available in the tutorials area). Otherwise you could have a variable for whether the character is facing right or not that can be set to true or false depending on whether the right or left movement buttons are pressed and use that, but unless you're moving your person in all sorts of crazy ways, that's probably overkill.

  • mmmh can explain me how ?

    Sprite :

    character (Animation : Left - Right - Fire)

    bullet

    fire botton

    sparrow botton (for move)

    How is set now :

    /**CMD**/

    Touch - is touching left arrow = set animation left to character AND Simulate 8 direction Left

    Touch - is touching right arrow = set animation right to character AND Simulate 8 direction right

    /** Fire **/

    Touch - is touching fire button = set animation FIRE to character AND Spawn bullet on layer 1 ( mouth character)

  • solved with :

    Is ok or ?

  • That is the logic for directional shooting, for the animation you will need to set to mirrored or not mirrored based on what the controls are.

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