public void EvasiveManuevers(HitByBulletEvent evnt)
 {
     Robot.ClearAllEvents();
     Robot.SetBack(300);
     Robot.SetTurnLeft(90);
     Robot.SetTurnGunRight(90);
 }
Beispiel #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();
            }
Beispiel #3
0
        /// <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();
        }
Beispiel #4
0
        public override void OnHitByBullet(HitByBulletEvent e)
        {
            reverseDirection();

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

            Out.WriteLine("Oooouch" + e.Name + " me dio");
        }
Beispiel #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);
        }
Beispiel #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);
        }
 public void OnHitByBullet(HitByBulletEvent evnt)
 {
     count(evnt);
 }
Beispiel #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);
 }
Beispiel #10
0
 public override void OnHitByBullet(HitByBulletEvent evnt)
 {
     RunProgram(TableRexPrograms.onHitByBullet);
 }
Beispiel #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;
 }
 public override void OnHitByBullet(HitByBulletEvent evnt)
 {
     if (AllowChange())
     {
         SwitchTurning();
         SwitchDirection();
         SwitchTurningDirection();
     }
 }
Beispiel #14
0
 public override void OnHitByBullet(HitByBulletEvent evnt)
 {
     publisher.publish(evnt);
 }
 public void OnHitByBulletBehavior(HitByBulletEvent evnt)
 {
     //throw new NotImplementedException();
 }
 public void OnHitByBulletBehavior(HitByBulletEvent evnt)
 {
     EvasiveManuevers(evnt);
 }
Beispiel #17
0
 public override void OnHitByBullet(HitByBulletEvent evnt)
 {
     ReverseTurn *= -1;
     SetAhead(rnd.Next(40, 200) * ReverseTurn);
     SetTurnLeft(30);
     Execute();
 }
Beispiel #18
0
 public void OnHitByBulletBehavior(HitByBulletEvent evnt)
 {
 }
Beispiel #19
0
 /// <inheritdoc />
 public virtual void OnHitByBullet(HitByBulletEvent evnt)
 {
 }
Beispiel #20
0
 public override void OnHitByBullet(HitByBulletEvent evnt)
 {
     state = myState.Panic;
 }
Beispiel #21
0
 public override void OnHitByBullet(HitByBulletEvent e)
 {
     TurnLeft(90 - e.Bearing);
 }
 /// <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);
 }