[Home]WSGunChallenge/DookiSaberWSGC

Robo Home | WSGunChallenge | Changes | Preferences | AllPages

package voidious.wiki;
import voidious.gun.*;
import voidious.utils.*;
import wiki.kmove.*;
import robocode.*;
import robocode.util.Utils;
import java.awt.Color;
	
/**
 * DookiSaberWSGC - by Voidious
 *
 * The gun of Dookious, the movement of Komarious.
 */

public class DookiSaberWSGC extends AdvancedRobot {
    KomariMover _movement;
    private DookiSaber _saber;

    public void run() {
        _saber = new DookiSaber(this, false);
    	_movement = new KomariMover(this);

        setColors(Color.black, Color.white, new Color(194, 174, 140));
        setAdjustGunForRobotTurn(true);
        setAdjustRadarForGunTurn(true);
        do {
            turnRadarRightRadians(Double.POSITIVE_INFINITY); 
        } while (true);
    }

    public void onScannedRobot(ScannedRobotEvent e) {
	    _movement.onScannedRobot(e);
    	_saber.onScannedRobot(e);
        setTurnRadarRightRadians(Utils.normalRelativeAngle(getHeadingRadians() + e.getBearingRadians() - getRadarHeadingRadians()) * 2);
    }

    public void onBulletHit(BulletHitEvent e) {
        _saber.onBulletHit(e);
    }

    public void onBulletMissed(BulletMissedEvent e) {
        _saber.onBulletMissed(e);
    }

    public void onHitByBullet(HitByBulletEvent e) {
        _movement.onHitByBullet(e);
        _saber.onHitByBullet(e);
    }

    public void onBulletHitBullet(BulletHitBulletEvent e) {
        _saber.onBulletHitBullet(e);
    }

    public void onDeath(DeathEvent e) {
        _saber.onDeath(e);
    }

    public void onWin(WinEvent e) {
        _saber.onWin(e);
    }
    
    public void onSkippedTurn(SkippedTurnEvent e) {
        System.out.println("Turn skipped at: " + e.getTime());
    }
}

Robo Home | WSGunChallenge | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited July 21, 2006 22:07 EST by Voidious (diff)
Search: