CS 161 Final Project
Overview
You will be implementing a final programming project to demonstrate all of the programming and computer science skills you've mastered throughout the course. This is a chance to work on something that is of interest to you, while also reinforcing what you've learned. You should aim to make a project that you'd be proud to show off to your friends and family--an awesome "look what I made!" program that will make you the envy of everyone you know.
- You can work on this project individually or in pairs (of your choosing). Groups of three are allowed with special permission, though 3-person groups will be expected to create projects that are larger in scope (since there are extra person-hours involved).
- Note that this project is intended to be around the size of two normal homework assignments--you have about three weeks, but also have multiple people and will be able to use lab time to work.
-
Also note that unlike homework assignments, the steps to complete this project are not being organized or spelled out for you. Part of this assignment is to practice creating a Java program from scratch, using what you know about object-oriented programming and algorithm design. We are of course happy to answer questions and help you out (particularly with newer concepts), but the high-level design needs to come from you.
- That said, there are a couple of intermediate deadlines you will need to meet, described under "Schedule".
Schedule
You have until Tuesday, May 14 at 11:59pm to complete your project. (This is the day after the final exam, so you will have a chance to make some final changes without getting in the way of studying). However, there will be some deadlines along the way to help keep you on track:
-
Tues Apr 23, 5:00pm - Project Proposal
On Tues Apr 23, you will need to submit a short written proposal explaining what project you will complete. This proposal should contain a couple of parts:
- Names Include your name and who you are working with, if anyone. Note that each pair only needs to turn in one copy of this proposal.
- Project Description: Briefly (about a paragraph) explain what the project is. If you pick one of the suggested projects below, this should be easy. If you are choosing your own project, you will need to explain to me what the system is in some detail. Think about the user interaction: what will someone running the program see and do?
-
Program Structure:
You should describe how you are going to implement and structure your program. In particular, you should explain
- what classes your program will implement;
- what attributes and methods these classes will have;
- how these methods will work together (i.e., if one method will rely on another, etc.).
- Class Diagram: In addition to the above description, you should include a simple class diagram that illustrates how your classes will be related to one another (in terms of dependency and inheritance). The easiest way to produce this diagram is to make the skeletons (with attributes and method signatures) of your classes in BlueJ, and then just take a ScreenShot of the main window. For example: below is a class diagram of my implemention of the DancingTurtles assignment:
- Schedule Finally, you should include a brief description (a sentence or two) of what you intend to have completed for the alpha a beta demos (see below).
Overall, this proposal should be around a page or two in length. Be sure and proofread your proposal at least once--syntax and spelling is important in computer science, and so let's apply that to English as well!
I will read this over and get them back to you ASAP, so that you can get some feedback on whether the project will work out or not. You are also welcome to check in with me about your idea before your proposal is due (but you still need to write it up)!
-
Thur May 02 during lab - Alpha Demo
During lab on May 02, you will be showing Dan an "alpha" version of your project---what you have completed so far. This version should have some basic functionality: you should have something showing up on the screen, and maybe some basic logic. We're looking to see that you've gotten started and are making progress on the assignment. Since this will be about a week and a half in, you should be around 50% done.
-
Wed May 08 during class - Beta Demo
For our final class meeting, you should be ready to show off a "beta" version of your project to your classmates (like in small groups, not to the entire class!). This means your program should be basically functional, but might lack more advances features or polish. You should be 80-90% done at this point.
-
Tues May 14, 11:59pm - Final Project Due
Your final project is due at midnight on Tuesday, May 14 (the Tuesday of finals week, the day after the final exam).
Once more, in case you missed it: the project is due Tuesday, May 14 at 11:59pm.
Project Requirements
You are welcome to design your own project for this assignment. Pick something that you think would be fun to create, useful to use, or neat to show off!
However, no matter what you choose, your project should meet a few basic requiremnts:
- Your project should include a Graphical User Interface (GUI). This can either be a window with buttons and displays, or a painted graphical image. But it shuold not be just a command-line program!
- Along those lines, your project should include user interaction with the GUI: mouse and/or keyboard interaction, interaction with buttons, etc. Be sure and think about what makes the program easy and pleasant to use!
- Your project should include multiple classs. This means the project should be large enough that it has more than one component. Of course, giving the program a GUI means that you'll likely need at least two classes (one for the UI and one for the program model).
- ...that's about it really. :)
We have included a couple of suggestions for suitable projects below. You are encouraged to choose one of these projects, but are welcome to come up with your own idea!
Some Project Options
At this point you have the ability (the power!) to create full if simple applications. One great example of such applications are classic arcade games! These games follow very simple computational and graphical rules (since that was all that was available at the time), and so are quite feasible to put together. Some examples are discussed below.
- I have also included some advice for getting started, as well as potential targets for the Alpha and Beta demos. You are of course welcome to modify the targets (or the projects!), explaining the differences in your proposal.
Pong
Pong is a computer version of ping-pong, in which players control opposing "paddles" and try to knock a ball back and forth. If the ball gets past your opponent's paddle, you get a point. Whoever gets the most points wins!
Your game should allow two players to play using the keyboard (for example, one using the arrow keys and one using the 'w' and 's' keys). Players can move their paddles up and down on the screen, and when the ball hits the paddle it bounces off. The ball should also bounce off the floor and ceiling, and will need to detect when it has gotten past a paddle. An advanced program could have the ball bounce at a more extreme angle as it hits further away from the center of the paddle. Your game should keep track of the current score, and declare a winner (like first to 3 or first to 10).
A really advanced Pong game could include a computer-controlled paddle. This is not a requirement.
Getting started: Start by making two paddles that are able to move up and down based on keyboard input. You'll need to use a KeyListener for this. Start with getting the keyboard input, as it can be tricky (hint: make sure your target component is the "focused" window--the one the user is interacting with). Once you can move paddles, add a ball bouncing around the screen (look back at the BouncingBall lab for an example). Finally, you can then add in bouncing off the paddles and scoring points.
Alpha Demo: A program that can move two "paddles" (rectangles) on the screen in response to keyboard input.
Beta Demo: A program in which the paddles can bounce a ball back and force, and that registers when the paddle has missed the ball.
Breakout
Somewhat like a one-player version of Pong, Breakout is a game that involves using a paddle to bounce a ball around. However, instead of trying to knock the ball past your opponent, you are trying to aim the ball to hit and destroy a grid of different colored "bricks". If the player destroys all the bricks, they win! If they miss bouncing the ball too many times, they lose.
The paddle in this game could be controlled either with the keyboard (e.g., the arrow keys) or with the mouse (tracking only horizontal movement). The ball will need to bounce off of the walls and the bricks, but after it bounces off the brick the brick should be removed. You will need to check whether a brick has been removed or not (so you don't collide with removed bricks!), and if all the bricks have been removed let the player know that they won!
This project may be slightly more challenging than Pong (since you need to deal with bricks as well as paddles).
Getting started: You might start by making a ball that bounces around the screen (you can use the BouncingBall lab as a launching point). Then add in a row of bricks, making sure the ball can bounce off them (note that you can track what bricks exist by using a list (either an ArrayList or an array--perhaps a 2D-array to represent the grid!). Add the functionality to remove the bricks when they are hit. Finally, add in the moving paddle at the bottom so that the ball can bounce off that.
Alpha Demo: A program that has a ball bouncing around the screen, including bouncing off of positioned bricks.
Beta Demo: A program in which the ball bounces around the screen and removes the bricks when it hits them. Likely with a paddle it bounces off of as well.
Snake
Snake is another classic arcade game, and a staple of simple programming systems (my old graphing calculator came with a Snake game). In Snake you control the head of a snake, moving it in different directions based on user input. Note that the snake doesn't stop moving: you just indicate what direction it is going You're trying to move the head to eat a "pellet" or "dot", without crashing into the tail of the snake or any walls. Each piece of the tail follows the head exactly where it went---like you might do for a conga line of Dancing Turtles! In addition, the tail gets longer each time a pellet is eaten, making the game increasingly difficult. The goal is to eat as many pellets as possible before you crash.
Your program should allow the player to control the snake via the keyboard--different keys should tell the snake to turn in different directions, but othewise the snake will move one step each "frame" of the animation. The hard part will be tracking each individual piece of the tail: I suggest making an ArrayList of "segments", and then having each segment move to the position of the segment in front of it (with the "head" being the first segment, and moved in whatever direction it is facing).
Getting started: Start by making the head that runs across the screen in a particular direction--this should be relatively simple. You can then add the "tail", programming it to folow the head. Then add in the ability to change the head's direction using the keyboard, and finally add in the ability to collect pellets (as well as scoring).
Alpha Demo A snake that moves across the screen in different directions (with which direction hard-coded)
Beta Demo The snake moves across the screen in response to the keyboard, being able to turn around and have the tail follow. Snake should also be able to pick up randomly positioned "pellets".
Pac-Man (Challenging!)
If you're feeling ambitious, you can also try to implement a simple version of the greatest arcade game of all time: Pac-Man! Your Pac-Man game won't necessarily follow the exact details of the original (and it shouldn't, due to copyright restrictions), but can do some of the same details. The player should be able to control Pac-Man using the keyboard--Pac-Man can move around the screen (which may or may not look like a maze), collecting pellets when he steps on them. In addition, there should be "ghosts" that wander randomly around the screen; if Pac-Man runs into a ghost, he gets eaten! The goal of the game is to eat all the pellets.
Getting started: Start by getting Pac-Man to draw on the screen, and to be controlled with the keyboard. Add in pellets, and make sure Pac-Man collects pellets when he walks over them. Then add in the Ghosts (who can step in a random direction), who have the ability to eat Pac-Man. If you wish to use a maze, add in that before you get to the Ghosts: just having Pac-Man manuever through the maze and not being able to walk through walls can be a challenge!
Alpha Demo Pac-Man can be moved around the screen and collects pellets he steps over.
Beta Demo Ghosts wander around and chase Pac-Man.
Other Options
There are of course many other options for projects. These include other classic arcade games (Space Invaders, Asteroids, etc.). And again, you can also pick a different project. Maybe you want to extend a previous homework or lab in an interesting way (making a Graphical Evil/Cheating Hangman, or enhancing the Photoshopper for example). Or maybe you have another idea in mind--feel free to be creative!
Submitting
There are multiple compents and requirements in submitting your project: be sure to read them carefully!
- First, your project proposal should be uploaded to the ProjectProposal folder on the submission folder on hedwig. Please submit this either in
.doc
,.docx
, or.pdf
format. Your proposal is due at 5:00pm on Tues Apr 23. -
Your will need to upload your entire final project folder (including all source code) to the ProjectFinal folder on the submission folder on hedwig.
- Include a README.txt that explains what your program is and how it works (from a user's perspective). This is like an instruction manual.
- In addition, you will need to include a .jar executable file that can be used to run your program outside of BlueJ. We will talk about how to produce these files in class (it is really simple). Simple put this file inside your project directory when you upload your work.
- Be sure that your code is extensively documented so I can follow what is going on! Since you're making your own program, I'm coming at it fresh; help me understand the work you did.
Grading
This project will be graded based on roughly the following components:
- Project Proposal and check-ins [10%]
- Project is completed and functions as intended, without errors [35%]
- Code is well organized into proper classes and methods, with good cohesion and coupling [25%]
- Project interface is usable and polished [10%]
- Code documentation is thorough and precise (explains the "why" of the code, not the "what") [20%]