Permalink
Browse files

Bug fix for issue 13: bullet holes in cloud

  • Loading branch information...
1 parent 13d642b commit ab55c20c6d49d7c903c7b25619edefcdf024576a danbernier committed Nov 4, 2011
Showing with 10 additions and 4 deletions.
  1. +4 −4 ideExample/example/Main.java
  2. +4 −0 src/wordcram/EngineWord.java
  3. +2 −0 src/wordcram/WordCramEngine.java
View
8 ideExample/example/Main.java
@@ -76,13 +76,13 @@ private void initWordCram() {
.withAngler(Anglers.mostlyHoriz())
.withPlacer(Placers.horizLine())
// .withPlacer(Placers.centerClump())
- .withSizer(Sizers.byWeight(5, 70))
+ .withSizer(Sizers.byWeight(5, 90))
- .withWordPadding(6)
+ .withWordPadding(1)
// .minShapeSize(0)
// .withMaxAttemptsForPlacement(10)
-// .maxNumberOfWordsToDraw(500)
+ .maxNumberOfWordsToDraw(1000)
// .withNudger(new PlottingWordNudger(this, new SpiralWordNudger()))
// .withNudger(new RandomWordNudger())
@@ -105,7 +105,7 @@ public void draw() {
//fill(55);
//rect(0, 0, width, height);
- boolean allAtOnce = false;
+ boolean allAtOnce = true;
if (allAtOnce) {
wordcram.drawAll();
finishUp();
View
4 src/wordcram/EngineWord.java
@@ -76,4 +76,8 @@ PVector getCurrentLocation() {
boolean wasPlaced() {
return word.wasPlaced();
}
+
+ boolean wasSkipped() {
+ return word.wasSkipped();
+ }
}
View
2 src/wordcram/WordCramEngine.java
@@ -149,6 +149,8 @@ private boolean placeWord(EngineWord eWord) {
boolean foundOverlap = false;
for (int i = 0; !foundOverlap && i < eWordIndex; i++) {
EngineWord otherWord = eWords[i];
+ if (otherWord.wasSkipped()) continue; //can't overlap with skipped word
+
if (eWord.overlaps(otherWord)) {
foundOverlap = true;
lastCollidedWith = otherWord;

0 comments on commit ab55c20

Please sign in to comment.