sprite

how to display only a few sprites from a group at a time

how to display only a few sprites from a group at a time Question: i wanted to make a game start screen and wanted to show only a few buttons at a time from a group, but i did not want to create multiple groups for each screen as i think its not optimal. i …

Total answers: 1

How do I create an extendable bar sprite in PyGame?

How do I create an extendable bar sprite in PyGame? Question: I want to use the following asset in my game: It has specific pixelated borders and corners. So I want it to scale "extending" the inner part of the asset by repeating it until it matches the desired size. So I can render something …

Total answers: 2

Pygame. Sprite is still drawing after killing itself

Pygame. Sprite is still drawing after killing itself Question: I want to remove the sprite and not display it on screen after click. The screenshot show that the sprite is successfully removed from the group, but it is still drawn on the screen. I would be happy to get help on this matter. import pygame …

Total answers: 1

pygame sprite tagging and analyzing the stats of several sprites and one sprite

pygame sprite tagging and analyzing the stats of several sprites and one sprite Question: I tried to portrait my progress chart for my pygame test(simple test for making sure what function I should use) project, here is the chart: 1. call Player: Make player into all_sprite(), players() group, and shoot() the skill every second. 2. …

Total answers: 1

How to move multiple grouped Sprite images simultaneously in Pygame Sprite

How to move multiple grouped Sprite images simultaneously in Pygame Sprite Question: I am making a game with groups of birds, when I press a key I want all the birds to move at the same time but only one is moving. There are five birds that I create with a loop, but only one …

Total answers: 2

How to clean up sprites without covering other things?

How to clean up sprites without covering other things? Question: I’m trying to make tetris in pygame and I’ve got collisions and movement down but, when a mask collides with a placed block, the rect I use to cover the old sprite covers parts of the placed sprite: def replace(self): pygame.draw.rect(board_surface,(0,0,0),(self.rect.topleft, self.rect.size)) This code is …

Total answers: 1

how can i remove the black bg color of an image with no alpha layer

how can i remove the black bg color of an image with no alpha layer Question: So i started doing a game to pass the time and i don’t know how to solve this issue: my player is a part of a sprite sheet, the sprite sheet has a alpha layer so its transparent but …

Total answers: 1

How can I scale every image in a list?

How can I scale every image in a list? Question: Im having trouble on scaling every image in this list using a for loop, when I run it no scaling occurs. This is my list and my for loop: self.pokemon = [ pygame.image.load(‘/Users/gersh/PycharmProjects/snakeeo/venv/lib/resources/pokemon/bulbasaur.png’).convert(), pygame.image.load(‘/Users/gersh/PycharmProjects/snakeeo/venv/lib/resources/pokemon/caterpie.png’).convert(), pygame.image.load(‘/Users/gersh/PycharmProjects/snakeeo/venv/lib/resources/pokemon/charmander.png’).convert(), pygame.image.load(‘/Users/gersh/PycharmProjects/snakeeo/venv/lib/resources/pokemon/pidgey.png’).convert(), pygame.image.load(‘/Users/gersh/PycharmProjects/snakeeo/venv/lib/resources/pokemon/squirtle.png’).convert() def set_colorkey(self): for pokemon in self.pokemon: pokemon.set_colorkey((0,0,0)) pygame.transform.scale(pokemon, …

Total answers: 1

How to make a moving platform using Pygame

How to make a moving platform using Pygame Question: I am trying to implement a moving platform into my code,like one that moves side to side and the limites on how far from side to side could be set, however i am struggling to seem to find a way to do it with the way …

Total answers: 1