I'm making a 2d tile based game. In pygame I could create a map like this:
screen = pygame.display(resolution) map = pygame.Surface(width, height) for tile in all_tiles: map.blit(tile) screen.blit(map)
The strength of this is that I can scroll the map by changing the map surface x and y. Also all the in-game coordinates are conveniently set in relation to the map rather than the screen. However I can no longer use pygame, and I'm trying to switch to pyglet instead. As far as I can tell pyglet doesn't have an equivalent
surface class built in, and therefore I need to build my own, this is what I need help with.
pygame.Surface extensively without really understanding how it works (python programmers these days huh). So I'm hoping you can offer some insight on how to get started. I know it needs a width and height, as well as some kind of list of the sprites which have been 'blitted' to it, and that moving the surface itself moves all the contained sprites, so surfaces blitted to it are somehow anchored to the surface rather than the screen.
How is this stuff done in pygame, and how do we create a pyglet friendly version?