18,023 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
Advice
1
vote
2
replies
94
views
Python Pygame Pygbag
I am new to Python from having programmed in VBA my entire life, so please don't laugh at my code :-0. I know it is might be ugly and that it is not very consistent, and probably more VBA'ish that ...
-2
votes
1
answer
71
views
I need help getting the MOUSEWHEEL event to work [duplicate]
i'm trying to make it so that a surface moves whenever the user scrolls the mousewheel, like how this website moves when you scroll.
here's the code i'm working with so far.
scrollVal=74
for event in ...
-4
votes
1
answer
120
views
Pygame/Python window keeps crashing [duplicate]
I am a beginner to python & pygame, and im trying to make a pygame window. However, whenever the window opens, the window crashes and says not responding. can someone help me?
import pygame
...
3
votes
1
answer
127
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
59
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 ...
-4
votes
1
answer
113
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
162
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
131
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
64
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
102
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 ...
2
votes
1
answer
409
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
70
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
...
1
vote
1
answer
158
views
How to implement drag and drop to basic pygame chess engine [duplicate]
I'm building a chess engine using pygame as a personal project. I was following a tutorial but I want to go further.
For the moment I have the chessboard, the pieces in their initial position and the ...
0
votes
1
answer
132
views
How to decrease the brightness of an image in PyGame?
I know there's a similar question here - How can I change the brightness of an image in pygame? - but the answer only explains how to increase the brightness, without referring to how to decrease the ...
-1
votes
1
answer
104
views
PyGame inputs not working with Nintendo Switch Pro Controller
I'm trying to add controller inputs to a game I'm making but when pressing one of the buttons on the controller, the action is not being performed.
I was told to use JOYHATMOTION but the Pro ...