Inspiration
We are four freshmen at Rice University (Richa, Tobi, Aaron, and Bryan) participating in a Hackathon on the first-timers track. We wanted to create something exciting and fun for our first hackathon, and were inspired by Houston's space history, which led to the idea of building a space-themed video game, combining space exploration with financial decision-making. Our game, Space Tycoon, blends the thrilling action of dodging asteroids and collecting stars with the long-term strategy of managing your earnings.
What it does
In $pace Tycoon, you play as a pilot hired by a billionaire space tycoon to test their rocket. Your goal is to navigate through the asteroid belt, collecting shooting stars to earn money while avoiding asteroids that will cost you money. You control the rocket using the left and right arrow keys, but you're not alone—an AI-controlled pilot will compete with you to earn more money. Whoever earns the most money wins!
We also developed a supplemental website using Python Flask, HTML, and CSS. After the game, the website helps you manage your astronaut’s wage through a financial plan generated by querying the OpenAI API.
How we built it
The game was built using Python's pygame library. All the assets (backgrounds and sprites) were loaded using pygame.image.load() and scaled to fit the window. We created lists (asteroid_list and star_list) to track active asteroids and stars on the screen. Functions like spawn_star() and spawn_asteroid() generate new stars and asteroids at random intervals, adding them to their respective lists.
We used pygame.time to periodically spawn obstacles and employed update functions to remove objects outside the screen. Collision detection occurs when the rocket’s position overlaps with asteroids or stars. Near Jupiter, the rocket's speed is halved, adding to the experience of gravitational pull.
The website was built using Flask and has a form that inputs the astronaut’s earnings. It queries the OpenAI API to generate a financial plan for managing their money.
Challenges we ran into
One of the biggest challenges we faced was trying to implement angular rocket rotation with the left and right arrow keys. Although we attempted this, we ran into issues where Python would generate a new image for every slight rotation, distorting the quality of the rocket's image. We also encountered challenges balancing gameplay and functionality in the time constraints of the hackathon.
Accomplishments that we're proud of
We're proud of successfully creating a working game and website as a team of freshmen in our first hackathon. Building a functional AI competitor in the game was also a significant achievement. Additionally, incorporating the OpenAI API to extend the game into the realm of financial literacy was something that felt unique and impactful.
Log in or sign up for Devpost to join the conversation.