Tag Info

New answers tagged

1

Your problem here is that you are re-initializing the running_man variable inside of the while loop to zero every single frame. I suggest moving it to the outside of the loop so that it is only initialized once. Another problem that I see right off of the bat is that your event loop is inside of your "for man in running_man" loop. If you handle this as two ...


0

ktodisco's solution is good but requires numpy to be installed. I wanted my game to require no extra dependencies beyond Python and PyGame, so I searched for another solution and was inspired by this answer to a related question. This routine only requires a couple calls to fill() with blend flags: def colorize(image, newColor): """ Create a ...


0

I've used pygame extensively, and I have had problems with scale before. Have you tried not using destination surface and instead setting the returned function to another variable like: scaled_screen = pygame.transform.scale(screen, (screen_w * scaling, screen_h * scaling)) Then blitting that to the window at (0, 0)? It also might be easier to scale each ...


0

I did this once by drawing maps in GIMP and saving them out to portable pixmap format (PPM), because PPMs are really easy to parse. A PPM-parsing library (or a parser for a more complex image format, actually) might exist for Python already, but to keep this maximally useful for everyone, I'll explain the concepts. Just to get an idea of what we want, ...



Top 50 recent answers are included