@Override
    public void act() throws RestartException {
    	switch (mode) {
    		case WAITING :
    			if ((player.getX() == this.getX() || player.getY() == this.getY())) {
    				this.direction = this.getRandomDirection();
    				this.mode = Mode.RUNNING;
    	        }
    			break;
    		case RUNNING :
    			if (this.move(direction)) {
    				if (this.getX() == this.gridX() * YSPanel.TILE_WIDTH 
    						&& this.getY() == this.gridY() * YSPanel.TILE_HEIGHT) {
    					this.mode = Mode.WAITING;
    				}
    			} else {
    				this.mode = Mode.SHOOTING;
    			}
    			break;
    		case SHOOTING :
    			if (!shot) {
    				shoot();
    			}
    			break;
    	}
    }