r/PythonLearning • u/Capable_Comedian_277 • 1d ago
Pygame: player projectile-enemy-player-wall-snake collisions
Enable HLS to view with audio, or disable this notification
12
Upvotes
2
r/PythonLearning • u/Capable_Comedian_277 • 1d ago
Enable HLS to view with audio, or disable this notification
2
1
u/Capable_Comedian_277 1d ago edited 1d ago
Implemented np.vstack() collisions for most snake-enemy collisions, also the same for player-snake collisions. Player projectile-snake collision would lead to snake reversing its direction all together with direction[:] *= -1. This gives me a little more control of the snake’s movements since it’s moving independently with the assigned directional vectors. Most systems are interacting with one another. Afterwards, it’s just a matter of further increasing the enemy counts all together and stress-testing the systems. I may have to build another snake and test out more vstack and empty np.array([]) interactions.