diff options
author | Phillip <pacardon@u.washington.edu> | 2011-03-15 23:29:59 +0000 |
---|---|---|
committer | Phillip <pacardon@u.washington.edu> | 2011-03-15 23:29:59 +0000 |
commit | 65812af57a86bef6bfc82bf538a7a2de27eecfc5 (patch) | |
tree | 520cb13eeebe1ac6813b0f5cc8b25bbbccfba38b /src/tesseract/World.java | |
parent | ce4cfb6670eaba20e27f8c5f499980be59bf0853 (diff) |
Added failsafe remove in CollidableObject and World classes.
Increased the mass of the tank in TankMenuItem
ModifyableParticle now spawns 20 DyingParticles when it collides with something.
New Class DyingParticle, particle with a duration of 6 ticks.
Diffstat (limited to 'src/tesseract/World.java')
-rw-r--r-- | src/tesseract/World.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/tesseract/World.java b/src/tesseract/World.java index b2ca82a..3611806 100644 --- a/src/tesseract/World.java +++ b/src/tesseract/World.java @@ -215,10 +215,12 @@ public class World implements Observer { Iterator<PhysicalObject> itr = myObjects.iterator(); List<PhysicalObject> children = new LinkedList<PhysicalObject>(); - + List<CollidableObject> toRemove = new LinkedList<CollidableObject>(); for (int i = 0; i < myObjects.size(); i++) { CollidableObject obj = myObjects.get(i); - + if (obj.removeMe()) { + toRemove.add(obj); + } // Apply forces for (Force force : myForces) { if(!(obj instanceof Blimp)) { @@ -238,6 +240,9 @@ public class World implements Observer { } } + myObjects.removeAll(toRemove); + + /* In the "tick" method of your application, rather than call the old form of resolveCollisions to completely handle a collision, you can now: |