My Score adds to much every single time rectangle collides with other rectangle

So I’m trying to make it so that if my rectangle collides with an another rectangle/Point, it will move the Point y position away from the rectangle and will add one to my score. The problem that I’m …

How can I play song repeatedly using pygame.mixer.music.play()?

I have tried to repeat a song(mp3) using pygame module. The code is as follows from the site https://www.studytonight.com/tkinter/music-player-application-using-tkinter When calling this function, it …

Pygame How to check for second press of a key

Hi guys i’m making a game in python using pygame. I have a piece of code that shoots lasers from a ship in a space themed game. Here is the code: # Laser laserImg = pygame.image.load(‘assets/PNG/…

PYGAME – Move Character with Vector

I am teaching myself pygame and am looking at making my character able to rotate and then move in the direction they are facing. I can do the rotation but cannot get the character to move in the …

How to make entities take damage with color collision in pygame?

How do I make entities take damage with colors? I made a game with enemies shooting blue lasers and I want the player to take damage. And the player shoots a red laser. Upon detecting colors, I want a …

Pygame sprite not moving while jumping

I’m confused why my sprite is not moving while jumping. I’ve checked several times and changed my code over and over with no luck. My code is below and contains 3 pages, first contain the main loop, …

How can I rotate this object back and forth forever?

I have a bone arrow image that rotates. If it reaches a certain timer I want it to stop rotating on one side and start rotating the other. If the other side reaches its timer it should goes back and …

Getting Math domain Error but it is not because of negative values

So I am trying to make a tower defense game and I tried to make a back button and before it worked but now when I try it gives me a math domain error. I’ve seen online it may come if I take something …

How to fix Clock? For Chess. Python

I’m creating a Chess clock for my chess project. In chess there are time formats 5|5 is where each player (white and black) is granted a general 5 minutes, so when either player makes a move it adds 5 …

Pygame how to change background colour without erasing anything else

I’m making this drawing thing in Python with Pygame. I have functions that draw circles and rectangles, but I want to add a function that lets me change the background colour, while not erasing the …