I'm making a Platformer/RPG type game, and I keep getting the error pygame.error: Out of memory
whenever I run it. I did some digging and found that it's because the size of the area the player can explore at once is too big (5500px by 1200px), so when I change it to something smaller (5000px by 1200px, for example), it works. However, my issue is that this isn't even close to how big I want it to be. Is this to do with pygame, or my laptop? Also, I understand that loading and updating everything in the game in such a large area even when the player can't see it is probably not a good idea, so I'll also be looking for any alternative solutions.
Asked
Active
Viewed 289 times
1
-
displaying area should be small to use less memory and to use less to to blit it. So you should use area as small as possible. – furas Apr 20 '19 at 08:58
-
I know, but I want it to seem as though the player is in a large area, even if the player isn't. I can't figure out a way to do this though. – amoriod Apr 20 '19 at 09:07
-
you need surface with size of screen (maybe with small margin). You calculate position of object on full area, you check if it will be visible and you draw (or not) on area with screen's size. You don't have to keep all area to display it. – furas Apr 20 '19 at 09:19
-
Oh, okay. I'll see if I can do that. – amoriod Apr 20 '19 at 09:24
-
1in internet look for "scrolling camera" or "viewport" – furas Apr 20 '19 at 09:34