How do I compare two animation frames in one sprite to do something?

0 favourites
  • 6 posts
From the Asset Store
three fully animated characters ideal for your RPG side scroller projects
  • i have Sprite called 'Slot' i copied few times in layout for a simple inventory.

    Slot have default animation form 0 to 3

    0-empty

    1-banana

    2-apple

    3- mixed salad

    so player is clicking on slot and after LMB click animation frame is +1 RMB -1 (to change image of fruits)

    Question how can i make A CONDITION

    when i see in inventory Slot.animation frame is 1 (banana) and slot.animationframe is 2 (apple) play audio?

  • Use a sub event with the same click event and say if animation frame = 1 or 2 then play audio easyy

  • You mean compare animation frames of TWO instances of the same sprite?

    The easiest solution is to use a family. Add slot to a family, and use two conditions:

    Slot animation frame=1
    SlotFamily animation frame=2
    
  • You mean compare animation frames of TWO instances of the same sprite?

    The easiest solution is to use a family. Add slot to a family, and use two conditions:

    > Slot animation frame=1
    SlotFamily animation frame=2
    

    Its working Thank you! :)

    i try before with subevents or compare two values but family is working for me

  • If you know the IIDs of two instances, you can do this without the family:

    Slot(iid1).AnimationFrame=1 | Slot(iid2).AnimationFrame=2

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you know the IIDs of two instances, you can do this without the family:

    Slot(iid1).AnimationFrame=1 | Slot(iid2).AnimationFrame=2

    No i dont know what IID they have, i dont see this information in properties anywhere (?)

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