Here's the error:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: This actor is not in a grid.
at info.gridworld.actor.Actor.moveTo(Actor.java:158)
at kidnapCritter.makeMove(kidnapCritter.java:51)
at kidnapCritter.teleport(kidnapCritter.java:40)
at kidnapCritter.act(kidnapCritter.java:16)
at info.gridworld.actor.ActorWorld.step(ActorWorld.java:68)
at info.gridworld.gui.GUIController.step(GUIController.java:134)
at info.gridworld.gui.GUIController$2.actionPerformed(GUIController.java:109)
at javax.swing.Timer.fireActionPerformed(Timer.java:271)
at javax.swing.Timer$DoPostEvent.run(Timer.java:201)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at info.gridworld.actor.Critter.getMoveLocations(Critter.java:90)
at info.gridworld.actor.Critter.act(Critter.java:44)
at info.gridworld.actor.ActorWorld.step(ActorWorld.java:68)
at info.gridworld.gui.GUIController.step(GUIController.java:134)
at info.gridworld.gui.GUIController$2.actionPerformed(GUIController.java:109)
at javax.swing.Timer.fireActionPerformed(Timer.java:271)
at javax.swing.Timer$DoPostEvent.run(Timer.java:201)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at info.gridworld.actor.Critter.getMoveLocations(Critter.java:90)
at info.gridworld.actor.Critter.act(Critter.java:44)
at info.gridworld.actor.ActorWorld.step(ActorWorld.java:68)
at info.gridworld.gui.GUIController.step(GUIController.java:134)
at info.gridworld.gui.GUIController$2.actionPerformed(GUIController.java:109)
at javax.swing.Timer.fireActionPerformed(Timer.java:271)
at javax.swing.Timer$DoPostEvent.run(Timer.java:201)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at info.gridworld.grid.BoundedGrid.isValid(BoundedGrid.java:62)
at info.gridworld.grid.BoundedGrid.get(BoundedGrid.java:87)
at info.gridworld.actor.Actor.putSelfInGrid(Actor.java:121)
at atomicBomb.killAll(atomicBomb.java:28)
at atomicBomb.processActors(atomicBomb.java:14)
at info.gridworld.actor.Critter.act(Critter.java:43)
at info.gridworld.actor.ActorWorld.step(ActorWorld.java:68)
at info.gridworld.gui.GUIController.step(GUIController.java:134)
at info.gridworld.gui.GUIController$2.actionPerformed(GUIController.java:109)
at javax.swing.Timer.fireActionPerformed(Timer.java:271)
at javax.swing.Timer$DoPostEvent.run(Timer.java:201)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
and here's the code:
import info.gridworld.actor.Critter;
import info.gridworld.actor.Actor;
import info.gridworld.grid.Location;
import java.util.ArrayList;
import java.awt.Color;
import info.gridworld.grid.Grid;
public class atomicBomb extends Critter
{
private Location loc;
public void processActors(ArrayList<Actor> actors)
{
killAll(actors);
}
public void makeMove(Location loc)
{
}
public void killAll(ArrayList<Actor> actorsx)
{
for(Actor m : actorsx)
{
m.removeSelfFromGrid();
fire flame = new fire();
flame.putSelfInGrid(getGrid(), loc);
}
}
}

New Topic/Question
Reply



MultiQuote


|