Android Question Dragging a shape to fit multiple cells in a grid

Marvel

Active Member
Licensed User
Hi everyone,

I need suggestions on the best way to make a mini game that requires objects of different shapes take different positions on a grid. I've played around with shapes that omly occupies one cell on the grid but I've not been able to find a solution to a shape that occupies multiple cells while being able to place it anywhere on the grid.

The use case is:
- User drags shape on to the grid
- Grid shows green highlight if shape is within grid and if occupied cells are empty
- Grid shows red highlight if shape is outside grid or if cell is already occupied
- Shape should be able to occupy any space within grid unless there is another shape there already.

Pointers in the right direction will be very much appreciated.

I made a prototype of the idea below:

 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…