Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
I have 4 sprites (A, B, C, D). I drag and drop sprite C to the position of sprite B. They swap positions for each other. How do I do that?
Develop games in your browser. Powerful, performant & highly capable.
Give your sprites instance variables where you store the start position.
On start drag -> set Sprite_A.PosX/PosY to Sprite_A.X/Sprite_A.Y
On drop and overlap Sprite_B -> Set Sprite_A position to Sprite_B; Set Sprite_B to Sprite_A.PosX/PosY
Following example does swapping by clicking 2 sprite; https://www.dropbox.com/s/7cwh6xxz6ms9epw/match_by_swap.capx?dl=1
You can modify it to works with drag & drop behavior.
*if by clicking the link won't open, copy paste the link text into browser addresss
If you change the link suffix to ?dl=1 then downloads are automatic from dropbox.
Wow didn't know that. Thanks zenox98 for pointing that out.