Getting Started

Import CS496_Lab12.zip into Eclipse (Import->General->Existing Projects into Workspace->Archive File).

You should see source code for MarbleMadness, Panel, ViewThread, and Sprite.

Your Tasks

In this lab we will create a basic Marble Madness type game (except that the goal will only be to get the ball to stop in the center "hole" on the screen).

Set up sprite class

In Sprite.java:

Set up thread class

In ViewThread.java:

Set up the panel class

In Panel.java:

The game should now create a ball on the screen with a random velocity. The user's task is to make swipe gestures to change the velocity of the ball in such a way that it stops inside the hole. If/when they achieve this goal, the application should display a congratulatory message similar to:

image

For an added challenge, when the user completes a "level" reduce/move the hole location and restart the random ball. For an "insane" game, place multiple balls on the table simultaneously or have the hole move so that the player must match the hole's velocity.