CatchTheCreaturePanel

- .java Author Lewis and Loftus Solution to Programming Project 8.18 import import import i import javax.swing java.awt java.awt.event

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//******************************************************************** // CatchTheCreaturePanel.java Author: Lewis and Loftus // // Solution to Programming Project 8.18 //******************************************************************** / import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.Random; i public class CatchTheCreaturePanel extends JPanel { private Creature creature; private Timer animate; private int xOff = 20; private Random gen; private static final int DELAY = 50; // 20 frames per second private static final int INITIAL_X = 20, INITIAL_Y = 150, RESTART_POS = -20, HEIGHT = 100, MOVE_ODDS = 4; // 1 in 3 chances the creature will move //----------------------------------------------------------------- // Sets up the panel //----------------------------------------------------------------- public CatchTheCreaturePanel(Timer timer, Image creatureImage) { creature = new Creature (creatureImage); gen = new Random(); addMouseListener(new Catcher());
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/17/2011 for the course COP 3530 taught by Professor Davis during the Spring '08 term at University of Florida.

Page1 / 2

- .java Author Lewis and Loftus Solution to Programming Project 8.18 import import import i import javax.swing java.awt java.awt.event

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online