How do I +1 the frame for every shot?

0 favourites
  • 9 posts
From the Asset Store
Selection frame like in RTS games, works both on mobile and desktop devices.
  • First person shooter, mobile game, C3

    The player needs to shoot a energy card 3 times before collecting the points. Each time the card is hit I need the sprite to change the next frame. The frames are loaded, but how do I tell C3 to change the frame each time the card is hit?

    I've got:

    (Event) System > energyCard1Hit > 3

    (Sub-Event) System > trigger once

    Action: ????

    I'm guessing it's something like energyCard1Hit.Animationframe+1, what event/behavior would be best?

    Thank you.

  • Yes something like that, did you not try it first?

  • + Mouse: On Left button Clicked on card
    -> card: Set animation frame to card.AnimationFrame+1
    
    ----+ card: Animation frame = 2
    -----> card: Destroy
    
  • Yes something like that, did you not try it first?

    For 2 hours, that's why I'm asking.

  • > + Mouse: On Left button Clicked on card
    -> card: Set animation frame to card.AnimationFrame+1
    
    ----+ card: Animation frame = 2
    -----> card: Destroy
    

    Am I missing something? I've been at this for hours, I'm wondering if I've hit that point where I can't see what I'm doing wrong.

  • I got it!

    DUH! I'm using an Add On!! That's why it's not working. It works when I remove the addon sprite.

    Thank you.

  • No...

    You were using the Set Animation action, which takes a string - the name of the animation.

    You want to use the Set Animation Frame action, which takes a number.

  • oosyrag,

    You're right, but I was using an addon. Because of the addon I didn't have the Set Animation Frame action option for that sprite, I only had the Set Animation option.

    When I uploaded a sprite without the addon, I was able to use that Set Animation Frame action. Addons are a blessing and a curse.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What addon were you using? That would be bad if they removed default actions from the list and should probably be looked into.

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