bearkin333 Posted September 27, 2015 Share Posted September 27, 2015 I'm working on a project where I need to create a large map randomly. I've been looking up randomly generating rooms and algorithms for that business, but that's not really what's causing my problem.I generate a level-map, which is basically a grid of numbers that tells each spot in the grid what kind of tile it will be. After the level is fully generated, it goes through my level-map and generates tiles as sprites with physics bodies for the player to walk on. It's important that they be separate because each tile can be destroyed.Unfortunately, I'm finding that while this is fine in a 20x20 room, once I make levels like this any larger my game starts undergoing quite a bit of duress. At around 100x100, the game is incredibly slow. I don't think I'd ever need to make a room that large, but even then, I'm sure there's a better way to do all this, I just don't know what it is.Any ideas? Thanks in advance! Link to comment Share on other sites More sharing options...
bearkin333 Posted September 27, 2015 Author Share Posted September 27, 2015 Updating this thread because I've found a fix that works very well. By adding the tiles into a group, and doing group collisions against only the moving entities, rather than everything, I cut out each of the ten-thousand or so tiles colliding with each other. I'll leave this here for anyone else experiencing something similar. in mono, MichaelD and sombriks 3 Link to comment Share on other sites More sharing options...
Recommended Posts