Dynamic list of icons

Hello everyone!

I’ve been trying to get a list of icons set up in my game, although I’m having some trouble with subtracting items from the list and updating visuals accordingly. The code is pictured below. Thanks!


I think your issue is that when an object is clicked or collided with, only that object is picked. Adding a pick all objects before checking if the ID is greater than DeletedID should fix it.

Instead of an ID, you could use the X position. IDs can be a pain to setup and maintain.

Mouse is released
Crosshair is collision with Object
… DeletedX = Object.X()
… Delete Object

… Pick all objects
… Object.X() > DeletedX, set Object.X() - 32