New answers tagged

0

As other already said, the sprite.Group iterator yield its members in an unordered way (like a dict, not like a a list). So if you're after a simple unordered list (not properly shuffled with a random method - if you want that follow user744's answer), just get what it gives by default. The "problem" here is quite the contrary: how to get an ordered list ...


0

As others have already said, you should probably refer to a sprite by something else then its order of addition to the group. I'll try to give some examples of uses both using a group and a regular list. sprite.Group You can iterate over sprite.Group (or sprite.Group.sprites() - both give you the same) and check each sprite against some criteria. Should ...


2

The Pygame Rect already comes with a few collision detection functions that may just do what you need: pygame.Rect.contains: test if one rectangle is inside another pygame.Rect.collidepoint: test if a point is inside a rectangle pygame.Rect.colliderect: test if two rectangles overlap pygame.Rect.collidelist: test if one rectangle in a list intersects ...


0

It's hard to know what's happening without seeing example code but it could be the order with which you erase and draw the sprites. For example, if you had the following steps: Erase circle Draw smaller circle Erase player <-- this is where you might be erasing the smaller circle Draw player If the above is your problem, the fix would be to erase ...


3

Create two separate applications: Your actual game and a launcher. Configure your installer to create shortcuts for the launcher, not the actual game. When the launcher is executed, it first goes online and checks if there is an update for your game. When there is, it downloads it and patches the copy of the actual game. A lightweight way to do this is to ...



Top 50 recent answers are included