How to create multiple enemy objects with different coordinate loacations
Im trying to make a game on pygame for my school project. And i followed clearcodes ultimate guide for python where he creates a runner game. In that video he creates a single place where the enemy rects spawn in. But im trying to make a platformer game where enemies can appear in multiple places.
Having issues with pygame
I am coding but my pygame doesn’t show it’s windows bar, the code:
How to use for loop for these images?
This code looks very long and I can use a for loop. but how can I use it?
How to check if there is an upper collision in pygame,python
I have a ping pong game.And if the circle touches the top of the rectangle, then the circle changes its direction.how can I implement this?
Rounding down when moving in negatives in Pygame
Why does movement in the negatives (Left and Down) decreases when using 1.5 as move_speed?enter image description here
Adding Gameover screen in pygame
I would like to add a simple “Game Over” screen at the end of the game – when the player collides with the enemy, but not sure how to do this. Here’s what the game currently looks like:
Pygame: Centering a rect after using self.rect.inflate()
So basically I’ve been tryng to create a small RPG for a school project and have struck a wall when trying to use attacks. I wanted the hitbox for the attack to be bigger than the characters usual hitbox, so I looked around and found rect.inflate() which seems to work. But it only extened in the bottom right corner. So now what I want to do is center it around my character so it has equal distance on all sides. I did try rect.center with another rect which I gave the variables of the first rect before inflatiing it (when it was centered on the character) but that doesn’t seem to work. So what I’d like is either a solution to center it, or maybe a better way to do my attacks because for now I just put another animation on top of the non-attacking one.
How to remove background from transparent png when loaded in pygame
The following code loads a picture which supposedly has transparent background. However, the gray/white tiles are still visible on the screen.
Pygame sprite post-collision mouvemnt
I’ve made it so when the sprites of player1 and player2 collide, the code stops taking input and they do not move. I’ve been having trouble implementing the movement if the input after the collision is opposite to the direction of the collision, so that when the two sprites collide they don’t overlap and can move away from eachother.
Not correct rotation in Pygame using trigonometric functions
I’m trying to write a little physics simulation using only standart Pygame. I wanna to have a trapezoid a draw it using 4 dots. So I wanna to rotate every single of this dots independetly (not use pygame.transform.rotate
). I write a code that calculate a new coordinates of dot, after rotation around a pivot, using trigonometric functions.