I have a problem with my pygame script in which the way I check for collisions doesn’t seem to work with the x axis and presents some very frustrating and downright stupid errors. The way it works is I first check for movement in the axis of choice, here is an example in the y axis. I then get a
Tag: collision-detection
Non overlapping random shapes on 2D plane
Objective: I want to create random non-overlapping irregular rounded shapes (contours) on a 2D plane, similar to a sandstone microstructure as shown below, to perform an oil flooding experiment using computer vision. Approach: I have previously done a similar thing but with circular shapes instead of random shapes. The result is as below. Also, I am aware of the programming
getting the current color of the visible pixel in the pygame module
I am using PYgame to create an environment with multiple cars. etch car has its own radar where it can check the distance between obstacles. the problem that I am having is, how to get the color of a pixel. so if a moving car has the color purple and it is currently over the [x,y] Pixsle I will get
Pygame collision checking lists of hit boxes against each other only checks the last box in the list
I am coding a game in pygame and my entity objects have attribute lists of hit boxes. All the hit boxes are pygame.rect objects and when i have them drawn on the screen all of them show up but for some reason the objects only act like they collide if the last hit box in their list collides with 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 certain statement to be true. That would lower an entity’s health by one. If color collision is a thing, it can
Pygame collision with masks
I have made a putt-putt game and now I want to add a slanted wall type. Because of this, I need to use masks for the collision (until now I have just used rects). I have spent hours learning about masks and trying to figure out why my code won’t work. There are no errors, the collision just isn’t detected.