Inspiration
I was studying abroad in the Netherlands and I was learning math and physics as they related to videogames but I wanted to actually apply it to something that was fun and cool. So one weekend I built JumpingTanks.
How it works
It is a very simple game that uses the sprite's location in the map to simulate gravity and friction. The tank also shoots a ball with the click of the mouse and the balls simulated air resistance to lose momentum while also realistically reacting with each other and the walls of the map.
Challenges I ran into
When doing the calculations for simulating a collision between two balls there was an issue. The problem was that when two balls would collide they would then use their previous velocity and direction to recalculate and bounce away from each other. However if two balls collided with enough velocity then they would technically still be 'colliding' after the first collision recalculated their direction. This would lead to a collision loop where balls appeared to stick together and never correctly bounce off one another.
I fixed this problem by moving the balls slightly away from each other after a collision was detected, just far enough so that there would no longer be a mistaken collisions.
Accomplishments that I'm proud of
I was really happy with how quickly I was able to create it and how it actually looked pretty cool.
What I learned
I learned some basic pygame objects and methods and how fun it could be to make simple games.

Log in or sign up for Devpost to join the conversation.