Category "pygame"

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

Why is this code not making a grid of raindrops?

So, I need help with Pygame for Python 3.6. This is my first semester taking a programming class and, yeah, it's a homework assignment I need help with. I had t

Neon effect in pygame?

I am working with pygame project and I need to my game cubes will have neon effect. Does pygame have a function to make neon effect or somethink like this: pyga

Pygame/Python/Terminal/Mac related

I'm a beginner, I have really hit a brick wall, and would greatly appreciate any advice someone more advanced can offer. I have been having a number of extreme

How to make MOUSEBUTTONDOWN to only detect the left clicks?

MOUSEBUTTONDOWN detects Left, Right and MouseWheel events. I want to make it to only detect the left clicks. Source Code: import pygame, sys, time from pygame.l

Invalid color argument in pygame when trying to gradient

I'm trying to change each value of RBG from one color to another target color. My window is 700 units in width and I'm trying to draw 350 rectangles, each 2 pix

Pygame installed on windows, getting "pygame.error: Failed loading libwebp-7.dll" when trying to call pygame.image.load()

I've got python 3.9.1 running on a windows 10 machine. I have pygame 2.0.1 installed on my machine via pip (python -m pip install https://github.com/pygame/pyga

Python 'Out of memory' when opening image

import pygame from pygame.locals import * \ image = pygame.image.load('.\\w.jpg') I'm trying to load an 59MB jpg file and it fails saying 'Out of memory' I'm

Why when import pygame, it prints the version and welcome message. How delete it?

Why is there a message when I import pygame, it prints the version and welcome message. The message reads "pygame 1.9.4 Hello from the pygame community. https

Pygame window jumps out and disappears immediately

im very new to python, and im currently at chapter 12 on Python Crash Course. it asks me to build an alien invasion game, and im stuck at this point where I wro

how to remove draw objects from pygame window?

I am creating a game using pygame and python. I have drawn a rectangle in the window which acts as a button. But i need to know how to remove the button once it