Inspiration

In Fundamentals of Computer Science II, we were assigned homework to create a game inspired by Zty.pe, a spaceship typing game that shoots lasers at words as they fall down the screen. The goal of the game is to type each falling word before it hits the "ground".

With HackBeanPot being our first ever hackathon, we were determined to put our all in and create a project that we could be proud of. But at the same time, we did not want to neglect our duty as students to finish our homework! And so, we faced our first conflict: How can we decide which project to put more effort in?

Ultimately, we came up with a solution: What if we alter the homework, beef it up, and mold it to fit this year's HackBeanPot theme?

What it does

In this game, the user plays as a little guy on his Anti-Polluter Scooter as he embarks on a cross-Atlantic road trip to defeat trash bags that are polluting major world cities. The user is met with a road/sidewalk that covers 3/4 of the window. At each destination, the scene changes to a skyline view of a major landmark in each city. Travel with the little guy as he explores London, Sydney, Paris, New York, and Agra. As randomly generated "gibberish" falls from the sky in the form of trash bags, the user must efficiently type the words to remove the trash bag from the screen. Will the little guy succeed in his mission to save Earth from extreme pollution, or will he fail, making Earth inhabitable?

How we built it/Challenges

We started by using our homework as a base template.

Version 1: We focused on the movement of the words in terms of spawning and falling. We ran into issues where words would spawn on top of each other, infinitely.

Version 2: We focused on spawning words at random x coordinates, but staggering them by +(a certain number of) y pixels. By doing this, we solved the overlaying text issues. In this version, we also focused on limiting the number of words that appear on the screen. We struggled a lot here because in version 1, our implementation generated one word per tick, and there was no way to "stop" the tick.

Version 3: To fix this, we added an accumulator to count the number of words that have been generated so far. Then, we added a parameter in our onTick function to only generate words if the accumulator value is < 6.

Version 4: Since we used the javalib library from our Fundies 2 class, we were confined to the big bang functions that were defined in the class. To detect keyboard input, we used an onKeyEvent, and to detect if the game was over, we used the WorldEnd function. It worked! One slight issue, though. The WorldEnd function only allowed for one if condition and one else condition. How can we display multiple scenes for the multiple results of the game?

Version 5: We ended up doing a nested if statement in WorldEnds that checks if "you lost" or if you essentially "won" (by checking if your "level" was greater than the max amount of "levels" in the game). Otherwise, the game would continue by setting WorldEnds to "false" and calling makeScene().

Version 6: Great. We got that to work. Now our issue is that we have a million bajillion scenes for each location that we want to display. We solved this by adding a million bajillion if, else if, and else statements to makeScene() (bad design, sorry).

Version 7: Lastly, we overlayed the text on cartoon trash bags so that the trash bags would fall as the text did. Then, for extra fun, we made it so that as the little guy progresses through each location, more trash bags fall. For this, we used the equation level + 2.

Side note: We used Canva to create all of our scenes and icons!

Accomplishments that we're proud of

  • We are proud that we were able to put together somewhat nice art for our game!
  • We are amazed that we were able to finish this project in time, despite the three of us having a million -bajillion other assignments for other classes.
  • We are proud that we were able to collaborate (we used a collab classroom in Snell and projected the laptop screen on the TV)!!

What we learned

  • We learned how to persevere through hard problems and to precisely test our issues to narrow them down.

What's next for Anti-Polluter Scooter

We hope to talk to Dr. Leena Razzaq about how we could potentially host the project on a website. In the future, we want to implement animation features where the Anti-Polluter Scooter can shoot lasers at the trash bags, resulting in an explosion. We also want to figure out how we can make the road appear to be moving. Lastly, we want to fix up the UI and make it look nice and cracked out!

Built With

Share this project:

Updates