rendered paste bodypublic class BugRunner
{
public static void main(String[] args)
{ Bug mine = new Bug();
ActorWorld world = new ActorWorld();
world.add(new Location(9,5),mine);
java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager()
.addKeyEventDispatcher(new java.awt.KeyEventDispatcher() {
public boolean dispatchKeyEvent(java.awt.event.KeyEvent event) {
String key = javax.swing.KeyStroke.getKeyStrokeForEvent(event).toString();
if(key.equals("pressed SPACE"));
//mine.shoot();
if (key.equals("pressed UP"))
//mine.moveUp();
if (key.equals("pressed RIGHT"))
//mine.moveRight();
if (key.equals("pressed DOWN"))
//mine.moveDown();
if (key.equals("pressed LEFT")){
//mine.moveLeft();
}
return true;
}
});
world.show();
}
}