Browse files

Added clear path code. Also allows uppercase characters to be used to…

… trigger commands
  • Loading branch information...
1 parent 5c0ae3a commit 1f90dc278be122c8d75f7e0ab9434ede36ad9243 @muraliavarma committed Feb 6, 2013
View
BIN murali_varma_hw2/build-tmp/murali_varma_hw2$Creature.class
Binary file not shown.
View
BIN murali_varma_hw2/build-tmp/murali_varma_hw2.class
Binary file not shown.
View
11 murali_varma_hw2/build-tmp/source/murali_varma_hw2.java
@@ -100,13 +100,13 @@ else if(key == 'w') {
}
//commands
- if (key == 's') {
+ if (key == 's' || key == 'S') {
for (int i = 0; i < NUM_CREATURES; i++) {
creatures[i].init();
}
}
- if (key == 'p') {
+ if (key == 'p' || key == 'P') {
if (backgroundAlpha == 255) {
//if no trail, make it full trail
backgroundAlpha = 0;
@@ -117,6 +117,13 @@ else if(key == 'w') {
}
}
+ if (key == 'c' || key == 'C') {
+ int temp = backgroundAlpha;
+ backgroundAlpha = 255;
+ draw();
+ backgroundAlpha = temp;
+ }
+
//forces
if (key == '1') {
flockCenteringForce = !flockCenteringForce;
View
11 murali_varma_hw2/murali_varma_hw2.pde
@@ -85,13 +85,13 @@ void keyPressed() {
}
//commands
- if (key == 's') {
+ if (key == 's' || key == 'S') {
for (int i = 0; i < NUM_CREATURES; i++) {
creatures[i].init();
}
}
- if (key == 'p') {
+ if (key == 'p' || key == 'P') {
if (backgroundAlpha == 255) {
//if no trail, make it full trail
backgroundAlpha = 0;
@@ -102,6 +102,13 @@ void keyPressed() {
}
}
+ if (key == 'c' || key == 'C') {
+ int temp = backgroundAlpha;
+ backgroundAlpha = 255;
+ draw();
+ backgroundAlpha = temp;
+ }
+
//forces
if (key == '1') {
flockCenteringForce = !flockCenteringForce;

0 comments on commit 1f90dc2

Please sign in to comment.