示例#1
0
 public void EvasiveManuevers(HitByBulletEvent evnt)
 {
     Robot.ClearAllEvents();
     Robot.SetBack(300);
     Robot.SetTurnLeft(90);
     Robot.SetTurnGunRight(90);
 }
示例#2
0
            public void OnHitByBullet(HitByBulletEvent evnt)
            {
                double angle = robot.peer.GetBodyHeading() + evnt.BearingRadians;

                robot.hitByBulletAngle   = (int)(Utils.ToDegrees(Utils.NormalAbsoluteAngle(angle)) + 0.5);
                robot.hitByBulletBearing = (int)(evnt.Bearing + 0.5);
                robot.OnHitByBullet();
            }
示例#3
0
文件: Fire.cs 项目: markthor/robocode
        /// <summary>
        ///   onHitByBullet:  Turn perpendicular to the bullet, and move a bit.
        /// </summary>
        public override void OnHitByBullet(HitByBulletEvent e)
        {
            TurnRight(Utils.NormalRelativeAngleDegrees(90 - (Heading - e.Heading)));

            Ahead(dist);
            dist *= -1;
            Scan();
        }
示例#4
0
        public override void OnHitByBullet(HitByBulletEvent e)
        {
            reverseDirection();

            if (Energy > 50)
            {
                mode = "normal";
            }
            else
            {
                mode = "huiga";
            }

            Out.WriteLine("Oooouch" + e.Name + " me dio");
        }
示例#5
0
        public void OnHitByBulletBehavior(HitByBulletEvent evnt)
        {
            var bearing = evnt.Bearing;
            var directionToFace = 0;
            var bearingMinus180 = bearing - 180;
            if (bearingMinus180 > 0)
            {
                Robot.TurnTo(bearingMinus180, Helpers.TurnType.Robot);
            }
            else
            {
                Robot.TurnTo(bearing + 180, Helpers.TurnType.Robot);
            }

            Robot.Ahead(500);
        }
示例#6
0
        /// <summary>
        ///   We were hit!  Turn perpendicular to the bullet, 
        ///   so our seesaw might avoid a future shot. 
        ///   In addition, draw orange circles where we were hit.
        /// </summary>
        public override void OnHitByBullet(HitByBulletEvent e)
        {
            // demonstrate feature of debugging properties on RobotDialog
            DebugProperty["lastHitBy"] = e.Name + " with power of bullet " + e.Power + " at time " + Time;

            // show how to remove debugging property
            DebugProperty["lastScannedRobot"] = null;

            // gebugging by painting to battle view
            IGraphics g = Graphics;

            g.DrawEllipse(Pens.Orange, (int) (X - 55), (int) (Y - 55), 110, 110);
            g.DrawEllipse(Pens.Orange, (int) (X - 56), (int) (Y - 56), 112, 112);
            g.DrawEllipse(Pens.Orange, (int) (X - 59), (int) (Y - 59), 118, 118);
            g.DrawEllipse(Pens.Orange, (int) (X - 60), (int) (Y - 60), 120, 120);

            TurnLeft(90 - e.Bearing);
        }
示例#7
0
 public void OnHitByBullet(HitByBulletEvent evnt)
 {
     count(evnt);
 }
示例#8
0
 public override void OnHitByBullet(HitByBulletEvent e)
 {
     // Turn to confuse the other robot
     TurnRate = 5;
 }
 public override void OnHitByBullet(HitByBulletEvent evnt)
 {
     RobotBehavior.OnHitByBulletBehavior(evnt);
 }
示例#10
0
 public override void OnHitByBullet(HitByBulletEvent evnt)
 {
     RunProgram(TableRexPrograms.onHitByBullet);
 }
示例#11
0
            public void OnHitByBullet(HitByBulletEvent evnt)
            {
                double angle = robot.peer.GetBodyHeading() + evnt.BearingRadians;

                robot.hitByBulletAngle = (int) (Utils.ToDegrees(Utils.NormalAbsoluteAngle(angle)) + 0.5);
                robot.hitByBulletBearing = (int) (evnt.Bearing + 0.5);
                robot.OnHitByBullet();
            }
 /// <summary>
 /// Handle bullet hit event.
 /// Use radius sampling movement to ensure the next move position will move the robot away from the wall
 /// </summary>
 /// <param name="evnt"></param>
 /// <inheritdoc/>
 public override void OnHitByBullet(HitByBulletEvent evnt)
 {
     this.currentMovementMode = MovementMode.RadiusSampling;
     this.collisionTime = evnt.Time;
 }
示例#13
0
 public override void OnHitByBullet(HitByBulletEvent evnt)
 {
     if (AllowChange())
     {
         SwitchTurning();
         SwitchDirection();
         SwitchTurningDirection();
     }
 }
示例#14
0
文件: RoboMom.cs 项目: mokhan/irobot
 public override void OnHitByBullet(HitByBulletEvent evnt)
 {
     publisher.publish(evnt);
 }
示例#15
0
 public void OnHitByBulletBehavior(HitByBulletEvent evnt)
 {
     //throw new NotImplementedException();
 }
示例#16
0
 public void OnHitByBulletBehavior(HitByBulletEvent evnt)
 {
     EvasiveManuevers(evnt);
 }
示例#17
0
 public override void OnHitByBullet(HitByBulletEvent evnt)
 {
     ReverseTurn *= -1;
     SetAhead(rnd.Next(40, 200) * ReverseTurn);
     SetTurnLeft(30);
     Execute();
 }
示例#18
0
 public void OnHitByBulletBehavior(HitByBulletEvent evnt)
 {
 }
示例#19
0
 /// <inheritdoc />
 public virtual void OnHitByBullet(HitByBulletEvent evnt)
 {
 }
示例#20
0
 public override void OnHitByBullet(HitByBulletEvent evnt)
 {
     state = myState.Panic;
 }
示例#21
0
 public override void OnHitByBullet(HitByBulletEvent e)
 {
     TurnLeft(90 - e.Bearing);
 }
示例#22
0
 /// <summary>
 /// Handle getting hit by a bullet (i.e. start moving in hopes of getting out of the way of the
 /// next bullet).
 /// </summary>
 /// <param name="evnt">The <c>HitByBulletEvent</c> args containing data about the bullet that 
 /// hit us.</param>
 public override void OnHitByBullet(HitByBulletEvent evnt)
 {
     _treads.ReactToBulletHit(evnt);
 }