A short game playing with a gravity mechanic. Repel or attract yourself towards or away from objects to reach the end of the level. The goal is the red square situated at the top of the map.


The force of the attraction/repulsion is based on your distance to the object and the mass of the object. Larger or closer objects will provide more force as illustrated in the gif below:


I made this game for Trijam #189. The game took the full 3 hours to make. I built the game in Unity, which I'm a bit rusty on, so most of the time was spent debugging and relearning the api. 

To get the gravity physics to be accurate, I implemented a point-based vector system to simulate the mass of the objects. Each object generates a grid of contained points on game-start and those points are tested against for the attraction and repulsion mechanic. To calculate the force, I used a modified gravity equation with distance cubed instead of squared for the divisor, as this seemed to give the user better control.

For next steps I'd like to include more levels, sounds, some art assets like a character and asteroids, and a star-field parallax background. I think it would be interesting to see how far you can take this idea just with the current game mechanics and what level designs would yield interesting challenges.

Leave a comment

Log in with itch.io to leave a comment.