This question already has answers here:
How do I detect collision in pygame?
(5 answers)
How to detect collisions between two rectangular objects or images in pygame
(1 answer)
Closed 2 years ago.
I want to make that every tile has a hitbox...
And how to check if player collides with them...
Heres the code:
http://pastebin.com/56LbcMPA
EDIT: And i need help with this!
Related
This question already has answers here:
How to implement barriers to stop the player moving through walls
(1 answer)
Adding collision to maze walls
(1 answer)
Closed 4 months ago.
In my program, there is a small cube which you can move around. There are also walls, but the cube is able to move through the walls. Is there any way to make the walls solid such that the cube can't move through them?
I haven't tried anything yet.
This question already has answers here:
How can I crop an image with Pygame?
(4 answers)
How to blit from the x and y coordinates of an image in Pygame?
(1 answer)
Closed 6 months ago.
I was recently making a Chrome Dino Run game using pygame.But I run into trouble when I was trying to a part of an image. I download this image of lots of little images from chromedino.com:
the image I download.
I tried to use pygame.transform.chop() to do that, but it dons't seem to work. Is anyone know what to do? Thank you for you time!
This question already has answers here:
How to get keyboard input in pygame?
(11 answers)
How can I make a sprite move when key is held down
(6 answers)
Closed 2 years ago.
So I have a small problem.
I am a beginner and I am just making my first game, chose to do a pong clone.
However, I can not move the second paddle with the keys a and z and for the life of me I canĀ“t find out why.
I would be extremely grateful if someone could help me.
Just for heads up, laud mean paddle, pall means ball and aken means screen. I am not a native speaker.
This question already has answers here:
How do I rotate an image around its center using Pygame?
(6 answers)
How can you rotate an image around an off center pivot in Pygame
(1 answer)
Closed 2 years ago.
I'd just like to change the degree an object is rotated at, pygame.transform.rotate increments it.
Can you directly edit the object's attributes? Printing the object just displays <Surface(50x50x24 SW)>
This question already has answers here:
How can you rotate an image around an off center pivot in Pygame
(1 answer)
How do I rotate an image around its center using Pygame?
(6 answers)
Closed 2 years ago.
I am making 2D Tank game and I have a problem with rotating my turret. Turret should rotate around its middle bottom but it rotates around the center.
def turret_rotate(self):
turret_rot_image = pygame.transform.rotate(self.turret_image,self.turret_angle)
turret_rot_rect = turret_rot_image.get_rect(center = self.turret_rect.midbottom)
return turret_rot_image,turret_rot_rect
can anyone help me?
solved