With this type of game your maps are in terms of tiles (I m assuming that by level you mean an individual level, not managing all of your levels). Each tile has
- an associated picture (what it looks like on the display)
- a type (ie, a wall, the ground, a trap, etc.)
When I create tile-based games in Pygame, I usually have a Map
class which contains the current map:
- the
pygame.Surface
of the map (what you ll be blitting to the display)
- a list of lists (ie, a matrix) where each item is a Tile object (I ve also done games where you just have a string that tells you what type of tile it is, and then you don t need a separate Tile class)
The map should be relatively static - you could have that traps become normal tiles after you step on them (this is pretty easy - when you do collision detection and it s a hit, just change that tile to a different Tile object (presumably the one for an empty tile)), but you don t want characters or movable blocks in the map if you can help it. Since the movable blocks have their own rules for how they can be moved, it s not as simple as just changing a tile - you d have a whole set of logic, and at least two tiles would have to be changed (and what if you could move the blocks onto traps - you d then have to remember, separately, what was below it - bleh). In my opinion it s easier to just have a class for each moving object and item.
In short, you have:
Tile
Map
Block
- other movable objects/sprites
And that s basically your whole level. For multiple levels, if individual levels are always the same, you can just have a list of Map
objects, one for each level.