Programming Assignment 3: a simple physics simulator

The goal of this assignment is to give you experience creating a model which simulates some game physics for a simple game.

The game is played in a 2D universe with a floor at elevation y=0.

There are three kinds of objects:
  • squares - which are static objects that have a center and width and never move
  • disks - which have a center, radius, and velocity.
  • jewel - this is a special square and the goal is to get a disk to hit the jewel
Game Rules:
  • The initial screen consists of a collection of squares together with one or more jewels and one or more disks.
  • The user can catch a disk (by touching it if using a GUI) and can move it horizontally.
  • To also get vertical movement the user must flick it (in a GUI, let go of the disk, then rapidly touch it and flick it) to set its new velocity.
  • Disks that hit squares become static and stick to the disk as if with super glue! Moreover, any disk that hits a static disk likewise becomes static.
  • Disks, which have not been captured by being touched by the user, are governed by the force of gravity where the units of distance are meters.
  • The goal of the game, given an initial configuration, is to flick the disks so that they hit the target square.
  • Only one disk can be moving at a time.
  • Once the user gets all of the jewels, or runs out of disks, or runs out of time, the game is over. If the user has collected all jewels, then they advance to the next level. Otherwise, they start over.

Deliverables

You should hand it your code via github.

Also create a quick screencast showing the code being tested.

Add links to both of these in your homework log.

Grading Rubric

You goal for PA-3 is to create this game with the following rubric:

3 = A level - create a model with clear, elegant code and excellent javadoc comments for the class and all public elements (constructors, methods, fields). The classes should all have a testThis method which runs a series of tests. Also create a text-based interface that lets the user play the game as described above with one level where they give commands to catch and/or throw a disk in increments of time dt.

2 = B level - create the model with good, well-documented code, and create a text-based interface that lets you step through the simulation in time steps of length dt (e.g. 0.1 seconds), and lets you give text based commands to move the object to the left or right or give it a velocity. After each time step the location of all objects is printed..

1 = C level - create a model, but  with incorrect code and/or inadequate documentation and/or poor testing of the code.

0 = E level - you don't hand in a credible program ....

Of course, we don't expect to see any level 0 or 1 homeworks!


Comments