Relative Content

Tag Archive for pythonpygamepgzero

Pygame Zero detect Color At Position

ok, is there any way to get the color of a specific pixel using pygame zero? I can’t find a way to get the color in the pixel at the position of an actor, so if there is a way to detect this I would be grateful if you could tell me, or if I would have to use some other library besides pgzero.

Python/Pygame: How do you get an actor to move around randomly/drift to a position?

I can’t get my actor to move around the screen randomly. I tried getting a random position to be generated and then slowly make it to drift diagonally or whichever way but I couldn’t get this to work as it just disappeared and respawned in the position instead of drifting. The reason I tried to already set the random position beforehand is so I can make sure it doesn’t go out of bounds.
The game is where you have to move the spaceship (ufo) and dodge the asteroids that are moving around randomly across the screen. There are three asteroids. I have currently coded the ufo’s movement, made the background and imported the asteroids. I don’t want it to just respawn in the position but for it to actually drift