Category "pygame"

How Do I Make a Circle Green When I Click It

I'm trying to make a Pygame window that has one thousand small circles and when I click one that circle will turn green. I am new to Pygame. import pygame impor

Python/Pygame make text in Pygame wrap when in leaves the window

I have a text function that render text.The function is the following def textFunc(font,msg,color,x,y,center): text_render = font.render(msg,True,color)

Pygame cannot make image bigger over time

I am trying to make an image get bigger over time for a cool effect. I've tried using this: import pygame from pygame.locals import * pygame.init() class Ima

PyCharm won't import PyGame

I'm fairly new to python and decided to try PyGame only to find it won't import. line 1, in <module> import pygame ModuleNotFoundError: No module nam

OOP using pygame.display inheritance error

import pygame.display.Display as display class MainDisplay(display): def __init__(self): super.__init__() # creating display X =

Why cant i place more than one rectangle in pygame?

I am trying to make a 2D game where the player can walk around with trees. But for some reason when the program tries to place a tree it doesn't appear. I have

Importing Pygame

I have installed pip and pygame module a few hours ago and when i try to import pygame module in my python import pygame print("well") file i get this error

How to make a window you can't exit with any python module?

I'm trying to make a classroom manager that can allow teachers to control the students' device during lesson.(Temporarily displaying a window to 'lock' the scre

I kept getting -805306369 (0xCFFFFFFF) error in Python while creating a pygame and fixed it but now I'm not getting any errors but script auto closes

I am creating a pygame simulation for planets rotating around the sun and ran into an error code of -805306369 (0xCFFFFFFF). I think I had an application loop b

Fatal Python error: (pygame parachute) Segmentation Fault using pygame.midi

I have been working on playing midi files within pygame and keep getting faced with this error. Fatal Python error: (pygame parachute) Segmentation Fault Pytho

How can you print the specific key pressed to the console in Pygame?

I am stuck on this. I am trying to output the specific key pressed to the console, but at the moment all of the keys pressed output "2". Help would be greatly a

How to dynamically change self variables, parameters, args... in multiprocessing?

I don't know much of Python yet, but I'm trying to create an app that controls multiple streams of sound simultaneously (It has to do with binaural beats, noise

Pygame drawing not showing in Pygame window

So I was testing out pygame and I wanted to draw a simple rectangle. There are no error messages when I run the code but the rectangle doesn't show up in the wi

Get images from images folder within pygame

I'm working on a game with pygame and I have the following directory for it: As you can see, I have an images folder in the package. Now I'm struggling, to get

Music Y or Music N

In python, "Music on or music off" . If user selects "Y" music will play, If user selects "N" I don't want music to play etc. Is this a "if, else type thing? Th

ModuleNotFoundError when importing Pygame after pip install Pygame

I was trying to make a simple snake game in Python so I installed Pygame using pip install Pygame. After I installed it successfully, I tried importing Pygame b

Controller Support in PyGame

Is it possible to add a purely python code to python, more specifically in the pygame module, so that it can take direct input from a Controller (XBox One, PS4,

How to laterally invert images in pygame?

I'm trying to use a sprite sheet, however it only contains images of the character facing right, I want to laterally invert these images when making the charact

Pygame black screen. Pygame just displays a black screen when i run this on vscode

Pygame black screen. Pygame just displays a black screen when I run this on vscode. What am I doing wrong? My pygame is just showing a blank screen when I run t

Is it possible to run game made with pygame on browser using pyscript?

I have made a small space invader game using pygame and I was wondering if I could play it on the browser using pyscript. Is this even possible ? Do I have to r