Greetings, I'm making a game in the “tower defense” genre, but with one tower on which you can set different floors, and today I ran into a problem.
I don't know how I can implement a floor swapping system, for example:
1) The player removes the first floor, and all floors from the top are shifted down to the vacant spaces.
2) A player wants to place a new floor, for example on the 3rd position, but it is occupied, however, when the player moves the cursor over an occupied slot, the floor that occupies the slot is shifted to the slot above, if it is free, if not, the player cannot place a new floor.
How can something like this be implemented? I will be extremely grateful for any help!