All pastes #2056736 Raw Edit

Anonymous

public text v1 · immutable
#2056736 ·published 2011-05-11 11:38 UTC
rendered paste body
public 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();
        
    }
}