From dc16d95ed5a4b5f15f327cbe609414dc9e5d6225 Mon Sep 17 00:00:00 2001 From: Adam Martindale Date: Wed, 7 Sep 2011 11:30:14 +0100 Subject: Begun adding text effect --- PunchingBag/src/PunchingBag.java | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'PunchingBag') diff --git a/PunchingBag/src/PunchingBag.java b/PunchingBag/src/PunchingBag.java index b36f562..d6eca55 100644 --- a/PunchingBag/src/PunchingBag.java +++ b/PunchingBag/src/PunchingBag.java @@ -1,5 +1,6 @@ import javax.swing.event.EventListenerList; +import java.awt.geom.Area; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; @@ -24,6 +25,10 @@ public class PunchingBag implements Runnable { None, Red, Yellow, Green }; + public enum Direction { + Right, Left, Up, Down + }; + // Is there a better class for this? One that it is not a swing class. private EventListenerList buttonListenerList = new EventListenerList(); private EventListenerList ledListenerList = new EventListenerList(); @@ -79,6 +84,26 @@ public class PunchingBag implements Runnable { abstract public void draw(); } + class Text extends Effect { + final String string; + final Area area; + final Direction direction; + final int speed; + + public Text(String string, Area area, Direction direction, int speed) { + this.string = string; + this.area = area; + this.direction = direction; + this.speed = speed; + + } + + public void draw() { + byte[] stringBytes = string.getBytes(); + + } + } + class CircleExpand extends Effect { final int x; final int y; -- cgit v1.2.3