I’d rather help convey ideas and suggestions that you can implement instead of making the game for you or taking your money.
What specifically are you having trouble with? I’m sure showing what you have and listing what’s not working can allow more people to maybe help.
If there’s ever something you can’t figure out how to do, there also is some simpler variation you can do to build your skills.
For example: have you tried your hand at doing all that logic with just squares instead of with an isometric grid? That would be one approach to work out the logic easier and you’d just make it isometric afterwards.
Or you could forget all the math and do it a different way.
1. Add a sprite for an isometric square and call it “square”. Draw it as an isometric square and put the image origin at the bottom corner.
2. Place a bunch of them down in the editor to make your iso grid just like the image of a grid you posted. To assist, you can turn on the editor’s grid and make the grid width to half the square’s width, and the height to half the square’s height.
3. Add another sprite for the isometric objects you want to move around. For example a “cube.” Draw an isometric cube and set the origin at the bottom corner. You can customize the collision polygon so it matches the image better if you like. Place one or more of those on the layout on top of the squares.
4. Next let’s get it ready for events. Add the drag drop behavior to the cube, and add an instance variable number to the square sprite and call it “occupied.”
5. Ok now events. The logic we are going for is to lock the cube objects to the nearest squares when not dragging. And we set the square’s occupied variable to true when there’s a cube on it so we can tell if a square is free or not.
Then events would look like:
Start of layout
— square: set occupied to 0
Start of layout
For each cube
Square: occupied=0
Square: pick closest to cube
— cube: set position to square
— square: set occupied to 1
Cube: on drag start
Square: pick closest to cube
— square: set occupied to 0
Cube: on drop
Square: occupied=0
Square: pick closest to cube
— cube: set position to square
— square: set occupied to 1
For each cube ordered by cube.y ascending
— cube: move to front
And viola! Basically no math to snap objects to empty spaces on an isometric grid. And ripe to be heavily tweaked to any more complex behavior you like.