Inspiration
Physics can be a demanding subject, particularly for those who have yet to find it captivating. At the start of the hackathon, we brainstormed on how we could make a game that is engaging to those with little previous exposure to physics while still showcasing some basic concepts found in the field. After some thinking, the best way to do this would be through the subject of Astrophysics and Lasers!
What it does
The main idea
With our initial inspiration, we started with the simple idea of shooting a laser and trying to "aim" it at a detector. If the laser hits the detector, you win the level.
Building up
Once we had the main idea created, we started thinking of ways to add complexity to our game. The obstacles and tools given to the player were the solution to making our game really a puzzle game.
Planet:
To include astrophysics, we added planets. Using the concept of gravitational lensing, we built planet objects in our game that the player could place. These could be used to bend the light from the laser. Once the player figures out how these can be used, they can turn the light to have it go in their desired direction.
Mirror:
Mirrors were simple enough to create and fell within the realm of optics. Using plane mirrors, the player can rotate them around to reflect their light beam in a desired direction.
Lens:
The lens is one of the trickier tools the player can use; following Snell's law of refraction, where the incident angle is equal to the refracted angle, the player can bend the light through the refractive medium.
How we built it
The game was developed using the GoDot engine, specifically with the built-in GDScript language. The lenses were implemented using Snell's law of refraction. The planets were created using the engine's physics, with adjustments that let the ball escape gravity fields, allowing for reliable and reproducible results. Overall, the engine provided all the tools necessary to develop the game, allowing us to focus on structure and features rather than boilerplate code.
Challenges we ran into
The main challenge was due to our zero exposure to the GoDot infrastructure and scripting language. Much of our time was spent learning the engine's behaviour and how to get it to do what we wanted. This gave us less time to pursue direct features to be added to the game. Every new feature that was thought of introduced more research time in figuring out how to actually mould the engine to our idea.
Creating the lens:
Creating the lens was a perfect example; the engine didn't allow for circular surfaces, making it necessary to implement code for every polygon of the approximated surface to handle collisions.
Dragging objects:
Another issue was understanding how events were handled in the engine; some tools are only available through the app UI, making them slightly hidden from new users. To drag and drop objects, an event signal was needed to detect when the mouse was hovering over the objects; this was hidden in a menu and was challenging to navigate until some research was conducted.
Lack of git support:
The GoDot client went through a recent overhaul that lacked built-in git support. This made tracking changes slightly challenging, as handling conflicts must be done with separate clients.
Accomplishments that we're proud of
When we started this project, no team member knew how to use the GoDot engine and the GDScript language. This didn't stop anyone from trying; after less than 48 hours, we proudly present our first game using GoDot and, for some, our first game ever! The aesthetic of our game fits within our initial vision without much sacrifice; the clutter-free environment and pixel art allow for a simple game that is relatively easy on the eyes.
What we learned
The biggest thing I learned was generally how to go about creating a game using the GoDot engine. Along with this, we learned how to use CDScript to develop classes for games. We knew how different game objects in CDScript interact with each other and how to create new situations upon interaction. The behaviour of collisions in tick-based physics engines was also necessary to learn to make the lenses, as the handling of their physics was different from that of other objects.
What's next for PAINT
Since we are working with light, adding some cool features related to it would be a significant new step. Interference and beam splitting could be implemented to create new ways to get around the puzzle. Adding a set of levels would also be a straightforward next step; as of now, the game is in a sandbox-like state. The levels would make it more "game-like" than the current state. Making the planets scalable to create stronger or weaker gravity fields would also be a fun addition.
Built With
- gdscript
- godot
Log in or sign up for Devpost to join the conversation.