Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

I hear you.  One option is make a list of all legal spawning locations for a map, then, for each enemy spawned, loop through the cells in a square around that enemy, swapping that cell location with the one at the bottom of the list of legal locations and decrementing the index of the bottom of the legal list by one.   When all enemies are placed, the player can safely spawn at random(index) location.  Does that make sense?  (I haven't had to use that algorithm for years, so I may have forgotten something.)