18,031 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
1
answer
70
views
pygame surface gives "display srf quit" on random line [duplicate]
I'm assuming it is not because of the line that the Exception appears on.
line 23, in <module>
screen.fill((0, 0, 0))
~~~~~~~~~~~^^^^^^^^^^^
pygame.error: display Surface quit
Process ...
-2
votes
0
answers
95
views
Need help optimising 2d Pygame/PyOpenGL rendering [closed]
I am working on a 2d game engine (and game) using Pygame-ce and PyOpenGL.
My issue is with FPS, I ́ve compiled to executables on both Linux and Windows and get the same result so it ́s not the ...
-4
votes
0
answers
64
views
Pygame crashes everytime I try to click [closed]
I'm working on a project where I have BMO as a home assistant, it uses fishaudio tts api, aswell as Gemini for conmversations, and pygame for displaying the face and anything else on the screen. This ...
-5
votes
0
answers
56
views
Why is this python/pygame code not working? (video system initialization and background colour) [duplicate]
I am a very amatuer programmer (most of code is borrowed from various other places).
There is 2 problems with this code and I can't work out why they are happening:
The background colouring is not ...
2
votes
1
answer
67
views
Pygame window not appearing
I'm using replit as my IDE, and I installed everything correctly. for some reason, when I run the code, it says it's running but has no pygame window in the display tab.
my code:
import pygame
import ...
0
votes
0
answers
48
views
Pygame particles force fields swirly effects
I'm trying to replicate some animation concepts of particles with force fields in order to generate a vertical beam of particles going upwards, except they can experience "turbulences" at ...
-1
votes
0
answers
42
views
Player Teleporting when hitting Object's border [duplicate]
I was trying to make some 2D plataformer physics, but when doing the collisions with objetcts, I encountered some annoying bugs. I usually could solve one of them, but the other one would appear. I ...
-1
votes
0
answers
110
views
Could not get EGL display
I’m trying to run the OpenGL cube demo from pygame using:
$ python -m pygame.examples.glcube
My setup:
OS: Ubuntu 24.04.3
Python: 3.12.11 (installed via Miniconda)
pygame: 2.6.1
GPU:
+--------------...
-4
votes
1
answer
103
views
Pygame image not facing the mouse [duplicate]
Here is my rotating code:
pos = pygame.mouse.get_pos()
x_dist = pos[0] - self.rect.centerx
y_dist = -(pos[1] - self.rect.centery)
self.angle = math.degrees(math.atan2(y_dist, x_dist))
self.image = ...
3
votes
1
answer
144
views
Pygame sprite is not visible
I am making a game in which you have to roll the blue block to the "Touch me" text. When I run the code, the blue block is not visible and there are no problems found in VS Code. How can I ...
-2
votes
1
answer
96
views
How do I remove blurry rendering in Pygame or Pygame-CE?
I am trying to make a pixel-art 2d platformer in Pygame-CE. When I use a standard pygame display, the pixels come out as blurry:
Minimal Reproducible Example:
#Import everything
import pygame, sys
...
1
vote
1
answer
62
views
Creating a class instance causes pygame to draw a black screen for 1 frame
I have different screens/menus set as instances of the Scene class. Whenever I want to switch screens, my gameloop checks for a button click, and if successful, it calls a function that defines the ...
-4
votes
1
answer
79
views
Collision glitchy because of movement in pymunk
I'm working on a little project (a video game) that asks me to use accurate physics events. My goal is to have 2 rectangles who can move (here with the keyboard) and can collide. In case of a ...
1
vote
0
answers
283
views
DRI3, libEGL, and MESA errors in Pygame
When running my Pygame 3d maze, I encountered a new error when loading it up.
Here is my error:
Environment updated. Reloading shell...
pygame 2.6.1 (SDL 2.28.4, Python 3.11.10)
Hello from the ...
0
votes
1
answer
68
views
Strange behaviour of pygame.event.clear in a for loop
I created a way to handle the inputs for my pygame project, but made a mistake that resulted in a code that works the same way as the following:
def run(self):
got_mouse_click = False
...