Skip to content
Advertisement

Tag: pygame

os unable to load image pygame.error: Couldn’t open imgspipe.png

source code : https://github.com/techwithtim/NEAT-Flappy-Bird line 28 – 31 (tech with tims flappy bird deep learning ai) i at first thought it was a local problem but after fiddling with python and uninstalling installing and reinstalling it i can conclude it is almost certainly not that. here’s the error: its an os error but everything that i’ve tried doesn’t work.everything in

Object escapes the window in pygame . How to prevent it from doing so?

So, I am python beginner and wanted to create a space invader game. But I’m facing an issue. The player object escapes the pygame window if I press the left arrow key or the right arrow key for a longer duration of time. Here’s my code – Before asking this question I’ve tried this but it doesn’t seems to restrict

Pygame doesn’t let me use float for rect.move, but I need it

I’ve recently recreated a version of Lunar Lander (you know, the old retro game) in Python 3 and Pygame: my lander moves (̀̀̀rect.move) each frame along the y axis because of gravity. Problem: Until I hit 1 m/s, the y value added to rect.move is a float under 1: I must use int() to round it up, as pygame doesn’t

Pygame : player sprite that disappears behind the background

So there you go, I wanted to experiment a little pygame but I find myself stuck. Context I created a small sprite (with Piskelapp) that represents the player and looks like: player.png then add my background in jpg format. However when launching the game, my sprite is cut by the background as follows: The ship is not placed in front

Running two files on a single project on PyCharm

I am currently developing a IoT sensor value simulator using the PyCharm IDE (along with pygame). Essentially, I am trying to produce/send data to Microsoft Azure IoT platform while there is a GUI available for users, in which they can see the temperatures of each sensor, change the sensor outputs, etc. Since I do not want to spam Azure with

Python3 PyGame how to move an image?

I tried to use .blit but an issue occurs, here is a screenshot to explain my problem furthermore: The image appears to be smudged across the screen following my mouse code: Answer Fix the indentation in your given code, it puts all the important stuff outside the while loop. You can also add a function that redraws the window each

ValueError: is not in list

I trying to make spaceship game from using pygame. Just simple game what warship shoot bullet and collide enemies. But when I play my game, after 6 or 7 collisions I get below error. creating bullet class creating enemy class and defining collide def calling collide definition in for enemy loop Then take this error after 6 or 7 time

Problem to install pygame on ubuntu 20.04LTS

I am on Ubuntu 20.04LTS, and I try to install pygame (for python) for a school project. But when I try this: I received an error: Can you help me, please? Answer Try installing it with instead. The error you are getting is because you are missing the Pygame dependencies, which apt should install for you. As a general rule,

Advertisement