Help with Drag & Drop Coin Stacking System (Frame Change + Count Logic)

Not favoritedFavorited Favorited 0 favourites
  • 5 posts
From the Asset Store
Selection frame like in RTS games, works both on mobile and desktop devices.
  • Hi everyone! I'm trying to build a drag-and-drop system in Construct 2 where coins can be stacked visually and counted logically.

    Here’s what I want to achieve:

    When the player drags one coin sprite and drops it on top of another coin of the same type, the system should:

    Add +1 to a variable (e.g., CoinCount) on the receiving coin.

    Change the animation frame to visually represent the stack (e.g., 2 coins, 3 coins, etc.).

    Continue updating the count even after the frame reaches the maximum (frame 5), but stop changing the frame beyond that point.

    So for example:

    Frame 0 = 1 coin

    Frame 1 = 2 coins

    Frame 2 = 3 coins

    Frame 3 = 4 coins

    Frame 4 = 5 coins

    Frame stays at 4 even if CoinCount goes beyond 5

    The dropped coin should be destroyed after stacking, and only the receiving coin should update.

    I’ve tried using On DragDrop drop, Is overlapping, and Pick nearest, but I’m struggling to get the picking and frame logic working correctly.

    If anyone has a working example or can guide me through the correct event structure, I’d be super grateful!

    Thanks in advance 🙏

  • This is not easy to do without families (which are not available in the free version).

    Here is a demo:

    dropbox.com/scl/fi/91g1zzp10wvm536mbcx18/ManyCoins.c3p

  • dop2000, Thank you so mutch for your reply and exemple! This method is for cs3, I'm using cs2, but i think i will buy cs3 and try it my self, thank you :)

  • C2 and C3 are quite different, you should always mention which version are you using when posting on the forum. You did, my bad.

    However, in this case, you can open my example in the free version of C3 and copy/replicate the events in C2.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes mate, I've told that I'm using Cs2 xD

    But anyway, thank you so mutch for your help!

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