public void EvasiveManuevers(HitByBulletEvent evnt) { Robot.ClearAllEvents(); Robot.SetBack(300); Robot.SetTurnLeft(90); Robot.SetTurnGunRight(90); }
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> /// 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(); }
public override void OnHitByBullet(HitByBulletEvent e) { reverseDirection(); if (Energy > 50) { mode = "normal"; } else { mode = "huiga"; } Out.WriteLine("Oooouch" + e.Name + " me dio"); }
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); }
/// <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); }
public override void OnHitByBullet(HitByBulletEvent e) { // Turn to confuse the other robot TurnRate = 5; }
public override void OnHitByBullet(HitByBulletEvent evnt) { RobotBehavior.OnHitByBulletBehavior(evnt); }
public override void OnHitByBullet(HitByBulletEvent evnt) { RunProgram(TableRexPrograms.onHitByBullet); }
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(); } }
public override void OnHitByBullet(HitByBulletEvent evnt) { publisher.publish(evnt); }
public void OnHitByBulletBehavior(HitByBulletEvent evnt) { //throw new NotImplementedException(); }
public void OnHitByBulletBehavior(HitByBulletEvent evnt) { EvasiveManuevers(evnt); }
public override void OnHitByBullet(HitByBulletEvent evnt) { ReverseTurn *= -1; SetAhead(rnd.Next(40, 200) * ReverseTurn); SetTurnLeft(30); Execute(); }
public void OnHitByBulletBehavior(HitByBulletEvent evnt) { }
/// <inheritdoc /> public virtual void OnHitByBullet(HitByBulletEvent evnt) { }
public override void OnHitByBullet(HitByBulletEvent evnt) { state = myState.Panic; }
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); }