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

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

            Out.WriteLine("Oooouch" + e.Name + " me dio");
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 7
0
 public void OnHitByBullet(HitByBulletEvent evnt)
 {
     count(evnt);
 }
Exemplo n.º 8
0
 public override void OnHitByBullet(HitByBulletEvent e)
 {
     // Turn to confuse the other robot
     TurnRate = 5;
 }
Exemplo n.º 9
0
 public override void OnHitByBullet(HitByBulletEvent evnt)
 {
     RobotBehavior.OnHitByBulletBehavior(evnt);
 }
Exemplo n.º 10
0
 public override void OnHitByBullet(HitByBulletEvent evnt)
 {
     RunProgram(TableRexPrograms.onHitByBullet);
 }
Exemplo n.º 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();
            }
Exemplo n.º 12
0
 /// <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;
 }
Exemplo n.º 13
0
 public override void OnHitByBullet(HitByBulletEvent evnt)
 {
     if (AllowChange())
     {
         SwitchTurning();
         SwitchDirection();
         SwitchTurningDirection();
     }
 }
Exemplo n.º 14
0
 public override void OnHitByBullet(HitByBulletEvent evnt)
 {
     publisher.publish(evnt);
 }
Exemplo n.º 15
0
 public void OnHitByBulletBehavior(HitByBulletEvent evnt)
 {
     //throw new NotImplementedException();
 }
Exemplo n.º 16
0
 public void OnHitByBulletBehavior(HitByBulletEvent evnt)
 {
     EvasiveManuevers(evnt);
 }
Exemplo n.º 17
0
 public override void OnHitByBullet(HitByBulletEvent evnt)
 {
     ReverseTurn *= -1;
     SetAhead(rnd.Next(40, 200) * ReverseTurn);
     SetTurnLeft(30);
     Execute();
 }
Exemplo n.º 18
0
 public void OnHitByBulletBehavior(HitByBulletEvent evnt)
 {
 }
Exemplo n.º 19
0
 /// <inheritdoc />
 public virtual void OnHitByBullet(HitByBulletEvent evnt)
 {
 }
Exemplo n.º 20
0
 public override void OnHitByBullet(HitByBulletEvent evnt)
 {
     state = myState.Panic;
 }
Exemplo n.º 21
0
 public override void OnHitByBullet(HitByBulletEvent e)
 {
     TurnLeft(90 - e.Bearing);
 }
Exemplo n.º 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);
 }