This site requires JavaScript, please enable it in your browser!
Greenfoot back

MuZiK's Comments

Back to MuZiK's profile

The javaDoc says it's thrown when a collection that is being iterated through is modified.
The error just somehow changed... java.util.ConcurrentModificationException at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372) at java.util.AbstractList$Itr.next(AbstractList.java:343) at Bomb.kill(Bomb.java:28) at Bomb.explode(Bomb.java:21) at Bomb.act(Bomb.java:15) at greenfoot.core.Simulation.runOneLoop(Simulation.java:288) at greenfoot.core.Simulation.run(Simulation.java:158)
java.lang.NullPointerException at Bomb.kill(Bomb.java:29) at Bomb.explode(Bomb.java:22) at Bomb.act(Bomb.java:16) at greenfoot.core.Simulation.runOneLoop(Simulation.java:288) at greenfoot.core.Simulation.run(Simulation.java:158) I'm getting that run-time error. for this code: public void kill() { List<Enemy> enemies = (List<Enemy>)getWorld().getObjects(Enemy.class); for (Enemy enemy : enemies) { enemies.removeAll(enemies); getWorld().modifyScore(enemies.size()*2); } }
Just play portal, you'll get the joke...hopefully.
Wow, to be honest, I had totally forgotten about the foreach loop...
The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie.The cake is a lie. Portal is awesome ^.^
Well, I remember from my java basics course that there was an iterator class or interface, but I can't remember how to use it :(
I think you should make the elevators enemies as well, since you can already air jump, they're not really needed.