Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

I'm not really an expert on procedural generation, but if your entire level is procedurally generated you could give your resources a radius and before spawning a new resource you create a new random position until the newly generated resource's radius and the old resources' radiuses don't overlap.

If you have fixed levels and only allow resources to spawn in certain areas, I'd recommend using tilemaps where each filled tile signifies a position where a resource can be placed. When generating the new resources you first check where it can be placed and if the tile is already occupied (a dictionary with vec2s might be useful to store the data here). If there is a valid tile where the resource can spawn you add the resource at the given position into the level and the runtime data.

If you only allow resources to spawn at specifc points, it'd be useful to implement a spawn point with a memory. I've heard some games do that by giving each spawn point a unique identifier (id) and storing the state of the spawn point in the runtime data (spawned, waiting for respawn). When the spawn point is then added to the scene it checks its state in the runtime data and acts accordingly (producing the resource or staying empty).

I'm trying to use the spawn on certain tiles one (using tilemap). Followed a guide on Youtube, which I think is similar to your idea (They record the occupied tile position to a dict and if there is already that tile in the dict, don't let the new resource spawn there), which worked nicely, but I had problem modifying it to work with larger-than-one-tile resources (for example, a tree might have width of 3 tiles and height of 2 tiles).