How do I Solve This (Drag & Drop) Match Animation Frame

0 favourites
  • 3 posts
From the Asset Store
Selection frame like in RTS games, works both on mobile and desktop devices.
  • Hi all!

    I am very new to Construct 2, but I really love it.

    I made an object with 7 frames, which I can Drag & Drop above some other sprite (water).

    On overlapping of this two I want to check if the object.AnimationFrame of the first object is the same as the second.

    If this is true destroy them. But when I am dragging the objects my global numbers are wrong.

    Please do this:

    1.) Drag frame number 3 above water (Frame1Number = 3)

    2.) Drag frame number 1 above water (Frame2Number = 1)

    3.) Drag frame number 3 back (Frame1Number =1, Frame2Number = -1) => until here everything is OK

    4.) Drag the same frame number 3 above water (Frame1Number =1, Frame2Number = 1)

    This is just an example. There are other problems too.

    I am tired of trying and trying. Can somebody please help me? How can I solve this?

    Attached you find an example (.capx)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Any help please? Can I solve this with other functions?

  • I've had trouble with some similar problems with this and I know how frustrating it can be. I really can't follow what you're trying to do in the event sheet. But I feel the algorithm should be:

    • When a tile is dropped on the water
    • - If there is another tile on the water, then check if they have the same frame number
    • - - if they have the same frame numbers, destroy both tiles

    I find a problem I've had many times in construct when using multiple instances of the same object, you need a way in the event sheet to specify which instances of the object need to perform actions. I'd recommend having a look at this tutorial:

    https://www.scirra.com/tutorials/280/cr ... ame/page-4

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