Inspiration
We wanted to delve into a new language and library, in addition to a unique architecture in software: game design.
What it does
It simulates lots of circles bouncing around the window with realtime interaction. More circles can be added while the program is running, as well as changing the thickness of the circles.
How we built it
We used Golang and the SDL2 wrapper for Go (SDL2 is originally a graphics library for C++). We utilized a game loop to constantly update the "game world" every 16ms (60 frames per second). In each "game tick" (every 16ms), the new positions of all the balls on the screen based on its currently velocity. If the balls are beyond the border of the screen, they are bounced the opposite direction to keep them on the screen. These updated positions and text info are then rendered. Because this is built in Golang, it is inherently cross platform, if the platform also supports SDL2 (which is built on C++ and also cross platform).
Challenges we ran into
Installing SDL2 and its accompanying plugins (ttf in this case) was a tedious process. Because this is a Golang wrapper of the C++ library, simply installing the Go modules was not enough. The SDL library had to be installed separately on the machine, and the dll's of the SDL2 library must be copied/included in the root of the program for it to execute.
Accomplishments that we're proud of
We are especially proud of the realtime interaction we were able to include, being able to support as many balls on the screen as the user wants, since the world simulation tick and the rendering are very efficient. This reduces any slowdowns and maximizing the maximum possible number of balls on the screen.
What we learned
We learned a new framework/library and how it can be used to make a cross platform desktop application with a real-time game loop.
What's next for Bouncing Balls
We hope to have the balls being able to collide with each other, but this introduces a lot of challenges, as a physics system is difficult to incorporate.
Discord: Satvik#2096
Log in or sign up for Devpost to join the conversation.