Tagged Questions
3
votes
1answer
43 views
How to make a map surface object
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)
...
1
vote
0answers
137 views
Pygame animation with different size sprites
I'm trying to create a simple top-view 2D rpg, in the style of Zelda and Secret of Mana, using PyGame. I've managed to make the beginnings of a game, with an animated character walking around. ...
1
vote
1answer
48 views
When to use pygame.sprite.GroupSingle?
I'm doing a game in which i have a ball which is controlled by the keyboard and the goal is to get is out of a maze without touching the walls.
I've added my ball sprite to GroupSprite
vehicle = ...
5
votes
1answer
475 views
Separating Sprites from Models with PyGame
So I'm trying to code a game using the Model-View-Controller pattern, and therefore have a need to separate the models for my game objects with their sprite representations. The problem that I'm ...
0
votes
2answers
339 views
sprite group doesn't support indexing
I have a sprite group created with pygame.sprite.Group() (and add sprites to it with the add method)
How would I retrieve the nth sprite in this group?
Code like this does not work:
mygroup = ...
1
vote
2answers
227 views
shuffle a sprite group
Is there a way to shufle a group of sprites created with:
pygame.sprite.Group()
I have tried using random.shuffle but it apparently doesn't work on sprite groups.