Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
1 answer
30 views

When I try to move Surface in Pygame, it seems to stutter in a weird way. Even when I use dt, the movement speed is not constant. Even thought FPS oscilate around 59-61, the Surface sometimes moves ...
Master Machine68's user avatar
-3 votes
1 answer
52 views

A few weeks back, I got a fresh new copy of Python 3.14 on my Windows 11 PC. So, as many of my projects use pygame and pgzero, I had to install it. But this bunch of error messages are appearing: ...
Mr. Dragonfly's user avatar
-2 votes
1 answer
68 views

The figure moves in different directions: left, right, up, and down. While moving, it should also fire in the direction it's moving when the space bar is pressed. In this code, when moving to the ...
fizer's user avatar
  • 1
-2 votes
0 answers
53 views

import os import sys import math import random import pygame from scripts.utils import load_image, load_images, Animation from scripts.entities import PhysicsEntity, Player, Enemy from scripts....
Ebrahim's user avatar
0 votes
1 answer
56 views

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 ...
WyvernSlayer 7's user avatar
-1 votes
0 answers
146 views

So I was trying to make a 3d engine from scratch in Python when i tried to rotate the plane. All axes were fine as predefined rotations in 3d space, but when updating rotation in the code, only the x ...
Mohammed H.'s user avatar
-3 votes
1 answer
115 views

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 ...
Dioa Plea's user avatar
3 votes
1 answer
104 views

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 ...
Staetyk's user avatar
  • 43
0 votes
0 answers
58 views

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 ...
Jeremy Baltigon's user avatar
-4 votes
1 answer
112 views

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 = ...
Aadvik's user avatar
  • 1,522
3 votes
1 answer
158 views

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 ...
Dat Nguyen Tien's user avatar
-2 votes
1 answer
122 views

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 ...
JustNeutral14's user avatar
1 vote
1 answer
63 views

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 ...
Sandwich's user avatar
-4 votes
1 answer
98 views

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 ...
Pax's user avatar
  • 19
1 vote
1 answer
367 views

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 ...
CloudDev's user avatar
0 votes
1 answer
70 views

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 ...
Simone Rosada's user avatar
1 vote
1 answer
149 views

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 ...
coding_chicken's user avatar
0 votes
1 answer
118 views

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 ...
Hello World's user avatar
-1 votes
1 answer
95 views

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 ...
uzn4v1's user avatar
  • 25
-1 votes
1 answer
64 views

I'm trying to make a grid towards the middle of the window and can get the tiles to update however if I click where the tiles are visibly on screen I get an error. The input seems to be stuck at the ...
kbrocks100's user avatar
1 vote
0 answers
130 views

I'm currently making a Sonic game using Pygame (full project here: https://github.com/Dingleberry-Epstein/Sonic-Pygame-Test) and I am stuck on how to perfectly handle loops, slopes and overall tile ...
miggle's user avatar
  • 57
-1 votes
1 answer
37 views

This is my first post, so I'm sorry if I do anything wrong. I'm developing a car game in Pygame (inspired by @javidx9 on YouTube), and I've run into an issue with the game timer. When the player ...
Allan Örtegren's user avatar
-2 votes
1 answer
50 views

I am using player = pygame.draw.rect(screen, player_color, player_pos, 30, 1, 1, 1, 1, 1) with screen as my surface player_color as my color player_pos as my rectvalue 30 as my width 1 as my ...
Wils Haverty's user avatar
0 votes
0 answers
48 views

I am creating an isometric minecraft clone and am having no problems except for 1. Blocks need to be placed in order from right-to-left if going left and left-to-right if going right. Not placing ...
getrie_G_h's user avatar
2 votes
1 answer
155 views

I've been trying to get a Sonic The Hedgehog game working in Pygame and it works for the most part. Sonic can run fast, jump across platforms like a normal platformer, gets affected by gravity, ...
miggle's user avatar
  • 57
-2 votes
1 answer
78 views

I imported math. whenever I try to use it and run the code, I get this error: AttributeError: module 'pygame.math' has no attribute 'sin' This is my code: def move(steps,): try_move(steps * math....
yurguydaniel's user avatar
3 votes
1 answer
97 views

I have a fairly typical pygame project with a game loop that processes events, updates game state and data, and then draws the next frame. That's all working. For various reasons, this is Windows only ...
HumanJHawkins's user avatar
0 votes
0 answers
70 views

I keep on finding people answer deceleration for characters but I can't find a way to apply this to a ball. I tried just subtracting an amount from the balls x and y vel but one would go to zero ...
unknown's user avatar
  • 11
1 vote
1 answer
57 views

I have an issue with pygame module. I have a small program where user can click on any place in a window and a ball will spawn there and start moving up-left with 45 degrees angle (135 actually) and ...
Егор Золин's user avatar
-2 votes
1 answer
122 views

im trying to make a tilemap maker and i stumbled on a problem when trying to get png file (tilesheet) the askopenfile function crashes, this is the button code self.tilemap_file_button = Button(self....
sgmmd's user avatar
  • 1
0 votes
1 answer
111 views

I am trying to draw some text using pygame.freetype.Font however for this font to look good in the context it's in, I want it to have a custom letter-spacing/kerning. By this I mean the ability to ...
MoltenWolfCub's user avatar
-1 votes
1 answer
84 views

When I load my image in pygame (see code below), the image appears pitch black, instead of drawing properly! Using Python 3.12.8 import pygame pygame.init() def imageload(imagepath): return ...
thesquaredude's user avatar
0 votes
0 answers
33 views

I'm trying to convert my pygame into .wasm using pygbag but getting the following error, as the site is no longer active: ERROR 404: https://pygame-web.github.io/archives/0.9/pythonrc.py Any ideas on ...
Mel's user avatar
  • 15
0 votes
1 answer
62 views

I'm developing a Python application using the HyperPixel 2.0 Round display (480x480) on a Raspberry Pi Zero 2W running Debian Linux 11. When writing directly to the framebuffer, I'm experiencing an ...
user28838679's user avatar
2 votes
1 answer
97 views

I'm learning the basics of the pygame library and already struggling. The "game" at this point only has a player and walls. There are 2 main surfaces: "world" (the actual game map) ...
JB the frequently clueless's user avatar
0 votes
1 answer
79 views

I was making an mp3 music player for myself. When pausing is enabled(key down), everything is fine, but if you turn off the pause, it skips the current music, although it should not do so. I've ...
Bublek's user avatar
  • 11
-1 votes
1 answer
43 views

I'm following a begginner tutorial to start using pygame, but I'm stuck with the sprite display. I'm not able to make it visible on screen, please find below the code related to the sprite. I'm not ...
Macronaute's user avatar
0 votes
1 answer
101 views

While writing my game in pygame I was trying to use the XOR (^) binary operator to 'toggle' flags any flag I passed to a function. However I kept running into Overflow errors (and Warning: re-creating ...
r5ne's user avatar
  • 13
0 votes
1 answer
73 views

I have made a top-down movement system in pygame, including acceleration and friction (the red square is the player): import pygame pygame.init() running = True x = 0 y = 0 speed = 3 friction = 10 ...
PythonCoder's user avatar
-3 votes
1 answer
379 views

Pip doesn't work. Python3 base install on Ubuntu wants package installs via apt install python-xyz. And I can't find pygame _@Sbox:~/Desktop$ python3 -m pip install pygame error: externally-managed-...
kpie's user avatar
  • 11.2k
0 votes
1 answer
83 views

I've recently created a camera which follows the player around the map. The camera centers the player in the middle and can zoom in and out with CTRL+Scroll wheel. camera_handler.py: import pygame ...
rubysilver's user avatar
0 votes
1 answer
66 views

I am trying to figure out what's the difference between pygame and SDL2 rectangle drawing. Here is my C code: #include <SDL2/SDL.h> const int WIDTH = 800; const int HEIGHT = 600; const int ...
backslash001's user avatar
-1 votes
1 answer
60 views

I was able to create the collision of 2 objects in PyGame using the calculation of Euclidian distance. Circles created are moving on the screen, changing the coordinates based on the "gravity&...
frky's user avatar
  • 3
3 votes
1 answer
89 views

I have a pygame mask of a text surface that I would like to invert, in the sense that the black becomes white, and the white becomes black. The black is the transparent part of the text, and the white ...
turtles's user avatar
  • 131
-1 votes
1 answer
50 views

So I am making a game for a school assessment where a turtle has to get to the water. Previously, I was playtesting the game as the turtle being a rectangle. But now I want the turtle to actually be a ...
Sandwich's user avatar
3 votes
2 answers
168 views

I am using the pygame_gui library. I am trying to make a textbox that when pressed enter it will print the text inside the box to the console and reset it (so the textbox will be empty). It does ...
user27379482's user avatar
1 vote
1 answer
51 views

Im trying to make it so when my picture bounces, the window changes to a random color, but when it changes, it only changes for a split second when it collides then the window changes back to white ...
azzy's user avatar
  • 11
0 votes
0 answers
41 views

I'm developing a drawing app in Python, and everything works smoothly with mouse input. However, when I use a pressure-sensitive stylus, the application crashes after a short period with the following ...
Kazber's user avatar
  • 23
2 votes
0 answers
71 views

I'm making a python project for school, and created a general Enemy Class, which is then to be inherited by every common enemy. I created a Goblin Class that inherits this, and it works as expected, ...
turtles's user avatar
  • 131
-1 votes
1 answer
83 views

I'm making a platformer game, and I'm trying to create the world but the sky.png file doesn't show up. I tried with other PNG files, and it still doesn't work. I inserted the location and coordinates, ...
未来の天才侍Tensai's user avatar

1
2 3 4 5
361