Hello GMS community. I have been at this for quite some time and know couple solutions but they seems... inefficient.
Problem: randomly place sprites like grass and flowers on an asset layer without overlap. For this i need to check if the location is free of collisions before placing the sprite.
solution 1: turn sprites to object and use collision functions(Overhead of objects is pretty high for this to be desirable)
solution 2: record the X and Y coordinates in array each time a new sprite is placed on the asset layer. loop though array each time a new asset is being placed to ensure its not within the same coordinates (with 10k+ sprites i dont even want to know how long this would take).
Tilemaps have tilemap_get_at_pixel, there does not seem to be something equivalent for sprites on a asset layer.
collision functions have not given me anything useful and behave strangely (maybe this is where im making a mistake)
For testing i attempted to retrieve the ID of the sprite on my mouse cursor but was unsuccessful.
Thank you for any suggestions, hopefully this will also help someone in the future.
Problem: randomly place sprites like grass and flowers on an asset layer without overlap. For this i need to check if the location is free of collisions before placing the sprite.
solution 1: turn sprites to object and use collision functions(Overhead of objects is pretty high for this to be desirable)
solution 2: record the X and Y coordinates in array each time a new sprite is placed on the asset layer. loop though array each time a new asset is being placed to ensure its not within the same coordinates (with 10k+ sprites i dont even want to know how long this would take).
Tilemaps have tilemap_get_at_pixel, there does not seem to be something equivalent for sprites on a asset layer.
collision functions have not given me anything useful and behave strangely (maybe this is where im making a mistake)
For testing i attempted to retrieve the ID of the sprite on my mouse cursor but was unsuccessful.
Thank you for any suggestions, hopefully this will also help someone in the future.