M
Matt93
Guest
I'm currently making a Bubble Shooter game. The room is set up with a ds_grid:
I'm trying to get the bubbles I shoot to snap to the nearest empty slot in the ds_grid. The bubble needs to land, then I need to detect which slot is closest to its x and y coordinates, whether this is empty, and pop the bubble into that slot. How would I do this in code? I don't know very much about ds_grids, so any advice with them would be amazing. This has been confusing me for ages and is getting quite frustrating. Any help would be really great.
Cheers!
Code:
global.grid = ds_grid_create(20, 15);
Cheers!