Relative Content

Tag Archive for pythonpygame

Pygame efficient more efficient creation of smoke than multiple individual sprites?

I am working on a small pet project in pygame (the community edition) implementing a 2D top down warship game.
I want to implement a chimney smoke coming from each ship, effectively creating a trail behind each ship. Since multiple images are loaded and converted to create the ships, guns, bullets etc, each ship and element draw function returns a list containing sprite, position and z-position, which are used by an engine class to draw all sprites to screen with screen.blit (using multiple cameras and having the option to zoom in/out and move the camera about).

Pygame efficient more efficient creation of smoke than multiple individual sprites?

I am working on a small pet project in pygame (the community edition) implementing a 2D top down warship game.
I want to implement a chimney smoke coming from each ship, effectively creating a trail behind each ship. Since multiple images are loaded and converted to create the ships, guns, bullets etc, each ship and element draw function returns a list containing sprite, position and z-position, which are used by an engine class to draw all sprites to screen with screen.blit (using multiple cameras and having the option to zoom in/out and move the camera about).

Rect object on top of another rect in pygame [duplicate]

This question already has answers here: How to make a collision system in pygame? (1 answer) How can I stop my player from glitching through my platform? (1 answer) Closed 4 hours ago. def draw_board(): global turn, board for col in range(0, 5): for row in range(0, 6): rect_bg = pygame.draw.rect(screen, THISTLE, [col * 100 […]

Rect object on top of another rect in pygame [duplicate]

This question already has answers here: How to make a collision system in pygame? (1 answer) How can I stop my player from glitching through my platform? (1 answer) Closed 4 hours ago. def draw_board(): global turn, board for col in range(0, 5): for row in range(0, 6): rect_bg = pygame.draw.rect(screen, THISTLE, [col * 100 […]

Rect object on top of another rect in pygame [duplicate]

This question already has answers here: How to make a collision system in pygame? (1 answer) How can I stop my player from glitching through my platform? (1 answer) Closed 4 hours ago. def draw_board(): global turn, board for col in range(0, 5): for row in range(0, 6): rect_bg = pygame.draw.rect(screen, THISTLE, [col * 100 […]

Rect object on top of another rect in pygame [duplicate]

This question already has answers here: How to make a collision system in pygame? (1 answer) How can I stop my player from glitching through my platform? (1 answer) Closed 4 hours ago. def draw_board(): global turn, board for col in range(0, 5): for row in range(0, 6): rect_bg = pygame.draw.rect(screen, THISTLE, [col * 100 […]

Rect object on top of another rect in pygame [duplicate]

This question already has answers here: How to make a collision system in pygame? (1 answer) How can I stop my player from glitching through my platform? (1 answer) Closed 4 hours ago. def draw_board(): global turn, board for col in range(0, 5): for row in range(0, 6): rect_bg = pygame.draw.rect(screen, THISTLE, [col * 100 […]

Why pg.mixer.music.get_busy() returns False if music is playing [duplicate]

This question already has answers here: How can I play an mp3 with pygame? (7 answers) Pygame, sounds don’t play (16 answers) Play WAV file in Python (5 answers) Closed 2 hours ago. I was making an mp3 music player for myself. When pausing is enabled(key down), everything is fine, but if you turn off […]

Pygame level/menu states

With my code below what would be the simplest and easiest way to implement game states to control levels? If I wanted to start with a title screen then load a level, and proceed to the next level on completion? If someone could explain the easiest way to handle this that would be great!

Pygame level/menu states

With my code below what would be the simplest and easiest way to implement game states to control levels? If I wanted to start with a title screen then load a level, and proceed to the next level on completion? If someone could explain the easiest way to handle this that would be great!