Java GUI project

profiletrujsobsk
optional_project.pdf

Extra Credit Project: Two Movable Vertices and Their Distance

Due date: Thursday 05/04/2017 Midnight on Blackboard

This is an optional project for students who want extra credits to boost your final

grade or who want to practice more coding.

Design and implement an application that plays a game called Catch-the-Creature.

Use an image to represent the creature (any image you can search online). Have the

creature appear at a random location for a random duration, then disappear and

reappear somewhere else. The goal is to “catch” the creature by pressing the mouse

button while the mouse pointer is on the creature image. Display a count of the

number of times the creature is caught. Add a “start” button and a “stop” button.

When start button is pressed, the play starts. When stop button is pressed, the game

is over and the creature stops at its current position and does not disappear

anymore.

Some things you would consider:

1. Separate your code into two java classes as the examples we used in class and labs: one to set up the frame and one to maintain the contents in your

pane.

2. Make sure your image is with proper size according to the panel size. You can check the width and height of an image by right-clicking the image, and

then properties and details. This helps you decide if the user mouse clicking

is within the image.

3. Timeline class should be used to implement the “disappear” and “reappear” effect.