aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <Adam Martindale@.(none)>2011-09-09 15:52:37 +0100
committerunknown <Adam Martindale@.(none)>2011-09-09 15:52:37 +0100
commit86abb5088585c6b88016362ffde7b5f3dfd568fe (patch)
tree5f2f5a43fd4644e262dfd58301aaf9b70babc1a1
parent056a5920ed894e7340a0dc4cfcebad4b8ff2c50b (diff)
downloadpunchingbag-86abb5088585c6b88016362ffde7b5f3dfd568fe.tar
punchingbag-86abb5088585c6b88016362ffde7b5f3dfd568fe.tar.gz
Finished drawRectCentre
-rw-r--r--PunchingBag/src/PunchingBag.java31
1 files changed, 26 insertions, 5 deletions
diff --git a/PunchingBag/src/PunchingBag.java b/PunchingBag/src/PunchingBag.java
index 0128120..5af23cf 100644
--- a/PunchingBag/src/PunchingBag.java
+++ b/PunchingBag/src/PunchingBag.java
@@ -232,12 +232,33 @@ public class PunchingBag implements Runnable {
boolean doneSomething = false;
int widthEx = 0;
int heightEx = 0;
-
+
do {
-
+ if (setLEDInternal((x - (height / 2)) + widthEx, y - (height / 2),
+ colour)) {
+ doneSomething = true;
+ }
+ if (setLEDInternal(x - (height / 2), (y - (height / 2)) + heightEx,
+ colour)) {
+ doneSomething = true;
+ }
+ if (setLEDInternal((x - (height / 2)) + widthEx, y + (height / 2),
+ colour)) {
+ doneSomething = true;
+ }
+ if (setLEDInternal(x + (height / 2), (y - (height / 2)) + heightEx)) {
+ doneSomething = true;
+ }
+ if (heightEx < height) {
+ heightEx++;
+ }
+ if (widthEx < width) {
+ widthEx++;
+ }
+
} while (height && width >= 0);
-
+ return doneSomething;
}
public boolean drawRectCorner(int x, int y, int height, int width,
@@ -274,10 +295,10 @@ public class PunchingBag implements Runnable {
heightEx++;
}
if (widthEx < width) {
- heightEx++;
+ heightEx++;
}
} while (height >= 0 && width >= 0);
-
+
return doneSomething;
}