Category "pygame"

How do you import Pygame in Sublime Text 4 on Windows 10?

I've been trying to use Pygame on Sublime Text 4 for the longest. But every time I try to import it into Sublime Text it says that there's no module named Pygam

How do I change this recursive approach to iterative approach?

This is a game function from pygame. If user press left (pygame.KEYDOWN.K_LEFT), angle -= 1. Else if user press right (pygame.KEYDOWN.K_RIGHT), angle += 1. 'Eve

The Pygame image is not loading up correctly [duplicate]

I am writing a game in PyGame. But when I want to load images, the background image is not loading up correctly. Also, no error message is sho

How Do You Add A Replay Button To A Game?

Im trying to make a replay button for my game where when you die the game pauses until you press the space bar which resets the game so you can play again. I'm

How to add Game Over image and play again function in Flappy Bird PyGame when sprite collides?

I am doing a flappy bird PyGame project for a computer science class. I have the main code, but when the bird collides with a pipe or the ground, it just stops.

Making tic-tac-toe with Pygame, blit doesn't work

I'm making a tic-tac-toe game using Pygame. Everything is good except that I don't arrive to make image2 and image3, who correspond to X and O, appear even afte

Setting var1 = Pygame.event.get() and var2 = Pygame.event.get() later in the code seems to lead to wonky results. Why? [duplicate]

In my code I was messing around and created code that looked something like this def checkformouseclick(): eventlist = pygame.event.get() for

pygame how to fix player going the opposite direction of left/right when colliding with the top/bottom of a mask

I have a program that detects mask collisions and moves the player to prevent it overlapping. It program works by moving the player by the dimensions of the are

pip install gym package but import error given

I created my tensorflow env using conda (MacBook Pro), and installed manually all the tensorflow required packages following the apple developer website: https:

Running into an Error 1 on Mac trying to install Pygame

I'm trying to install Pygame. I keep getting the following error. Resolved https://github.com/pygame/pygame.git to commit 3ce0b9ec80ba4f58cf640e3ea2b9ea188b35

Two arcs while using Pygame tranform.flip

This is my first real code project. I am trying to create a Crash gambling project for a math project at School. My current problem is that when I flip my arc i

in vscode, pygame wont import but it is installed and is working in the windows console ,and the python app thing

im very new to code in general so this could be a stupid beginner problem ive searched for things but i couldnt find something useful for me under Problems is t

Collect coins from the map in Pygame

I'm trying to make a pygame game but I'm having a problem. I want when a character collects a coin, the score will change by one and the coin will disappear. I

Pygame mouse position not precise enough to rotate the 3D scene

I need to rotate a 3D scene or a character using the mouse position: for example, if I move the mouse to the right, I want to turn to the right / the character

How to get tile selected with mouse?

New to pygame, and game development in general. This is my main loop and I am trying to blit just a tile selector image on top of the current tile that the mous

PyOpenGL texture isn't displaying correctly

I was trying to put texture onto quad with this code: import pygame from pygame.locals import * from OpenGL.GL import * from OpenGL.GLU import * from PIL import

How to make my Pygame window always active and listening for input?

I spent the last 3 hours searching for a way to create a simple toggle button script that lets me know if a button on my Thrustmaster HOTAS has been pressed. As

using methods of differents objects in pygame in a while True, chess project [duplicate]

I'm new to pygame, and OOP in python ( used a lot of java before) For a personal project, i'm trying to make a chess game, but I have a probl

Pause, unpause music in PyGame on KEYDOWN

I've created a game loop that pauses if the spacebar is pressed. The loop is pausing and unpausing as expected but the music playing in the background does not

How to calculate Kinetic energy and potential energy of a Ball?

I want to calculate the Kinetic energy and potential energy of the ball I just Spawned inside a Pymunk space. I wanted to replicate this. Where the values chang