How do I spawn a specific animation frame and make it stick?

0 favourites
  • 3 posts
From the Asset Store
Selection frame like in RTS games, works both on mobile and desktop devices.
  • I'm retrofitting an inventory demo. It's almost done, but I'm stuck.

    On the LEFT there is a sprite called StoreItem, that has many animations and each animation has many frames - and there are 25 copies of the sprite StoreItem, each showing a specific frame.

    On the RIGHT there is a sprite called InventoryItem where its animations and frames are identical to StoreItem, but the InventoryItem sprite is spawn.

    There is a variable called category.

    When category = 1 the sprite StoreItem shows all the frames for item_1

    When category = 2 the sprite StoreItem shows all the frames for item_2

    and so on and so forth.

    This is the issue:

    When category = 1, StoryItem shows all the frames in Item_1 (on the Left) and let's say the player taps frame 7, I need InventoryItem to spawn Item_1 frame 7 on the RIGHT. (I'm using CAPs for ME, not you.)

    Then if the player, let's say taps on the button that reads "At Home" and category = 2, all the images for Item_2 display on the Left (that part already happens), and let's say the player taps frame 2, I need InventoryItem to spawn again, but this time Item_2 frame 2 on the RIGHT, while leaving the original Item_1 frame 7 right where it is.

    Whatever frame the player taps on the Left needs to spawn on the Right and stay on the Right and be able to move around on the Right, until it is deleted or until the page is refreshed to start over.

    Because I am retrofitting an inventory demo, InventoryItem only shows frame 0 on the Right regardless of which frame is pressed, because that is what it was originally programmed to do and for the life of me, I can't make it spawn animation + frame in the next available space.

    Right now, it does everything right Except display the correct Item_X and frame #.

    I've been at this for a week and I'm at wits end.

    Context: My 16 y/o daughter has a disorder that only allows her to understand picture language (receptive and expressive) So, the typical devices don't work for her.

    If pulling at your heart strings helps .... I am just a mom who desperately wants to talk to her daughter.

    Any help is appreciated.

    Thank you

    This is the C3: drive.google.com/file/d/1CWx6AFjApSHL9cRLN--na0ftqbAxt3jU/view

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You were actually so very close so at least your understanding is good, in line 36 you used set to AnimationFrameCount, where instead it should be AnimationFrame. FrameCount is the total number of frames, Frame is the number value of the frame.

  • You were actually so very close so at least your understanding is good, in line 36 you used set to AnimationFrameCount, where instead it should be AnimationFrame. FrameCount is the total number of frames, Frame is the number value of the frame.

    OH MY GOD!! IT WORKED!!

    lionz Thank you Sooo Much!!!

    I'm going to finish this tonight. You have NO IDEA how happy you are going to make a grandmother tomorrow, on Mother's Day, when she talks to her granddaughter and for the first time her granddaughter will understand her!

    I am crying already.

    Thank You So Much!

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