when you lose
when you win
the goal is in sight
robot coming through
I am a part of my School's FRC Robotics Team. Before every competition, we get the same lecture about how we need to clear the hallway when someone is moving their robot. I thought it would be fun to make a game to train everyone on how to do it.
What it does
You are a little combustible lemon (that's the name of my FRC team). You control the lemon's movements around the screen. The word "Robot!!!" appears about a second before a robot comes barreling through the hall. To escape it, you have to move to the pits, but if you touch the wall, then you are thrown back into the hallway because that means there is no space for you in the pit. At the end, there is a green pit, which is yours and it means you got home safe.
How I built it
I used Java Graphics. Each object has a Rectangle around it and when the Rectangles intersect, something happens, depending on what the Rectangles are surrounding. The computer receives input from the KeyInput class. When the game ends, it either shows "game over" or "you win." The pit walls are randomly spaced out.
Challenges I ran into
Some of the code that worked for one object wouldn't work for the other. It was also difficult to find a way to switch between the game and the ending because it kept on glitching, but I got it to work.
Accomplishments that I'm proud of
I have never coded a game from scratch before, so I am proud of myself for figuring it out on my own.
What I learned
I learned a lot about java Graphics, JFrame, interfaces, and how to work with pictures. I had never really worked with java using pictures, so this entire experience was new and exciting.
What's next for FRCPitSafteyGame
I want to add other challenges: like putting away tools or finding the fire extinguisher to put out a fire. I also want to implement animation in the avatar and maybe implement a multiplayer mode for some unique multiplayer challenges. I also want to add a menu screen to select which challenge.