public override void onHitWall(HitWallEvent @event) { this.turnRight(90 - @event.getBearing()); this.back(10); this.turnLeft(180); this.ahead(40); }
public override void onHitWall(HitWallEvent @event) { this.turnRight(90 - @event.getBearing()); this.back(10); this.turnLeft(180); this.ahead(40); }
public override void OnHitWall(HitWallEvent evnt) { if (state == myState.Start) { if ((this.Y > BattleFieldHeight * 0.5 && this.X > BattleFieldWidth * 0.5) || (this.Y < BattleFieldHeight * 0.5 && this.X < BattleFieldWidth * 0.5)) { TurnLeft(90); TurnGunLeft(90); } else { TurnRight(90); TurnGunRight(90); } state = myState.FollowinWall; } else { invertDir = !invertDir; /* * if ((this.Y > BattleFieldHeight * 0.5 && this.X > BattleFieldWidth * 0.5) || (this.Y < BattleFieldHeight * 0.5 && this.X < BattleFieldWidth * 0.5)) * TurnLeft(180); * else * TurnRight(180); */ } }
public override void OnHitWall(HitWallEvent e) { Stop(); TurnRight(-90); //Ahead(bigStep); Resume(); }
public override void OnHitWall(HitWallEvent e) { Ahead(120); TurnLeft(100); Ahead(100); TurnLeft(10); }
public override void OnHitWall(HitWallEvent evnt) { for (int i = 0; i < behaviors.Count; ++i) { var behavior = behaviors[i]; behavior.OnHitWall(evnt); } }
public override void OnHitWall(HitWallEvent evnt) { try{ Back(Math.Abs(evnt.Bearing) < 90 ? 10 : -10); } catch (Exception ex) { Console.WriteLine("Could not move after wall collision: {0}", ex.Message); } }
private void ProcessEvents() { m_bMoveComplete = false; m_bTurnComplete = false; if (m_pEvents.Count > 0) { if (m_pEvents[0] is HitWallEvent) { HitWallEvent pEvent = (HitWallEvent)m_pEvents[0]; m_pEvents.Clear(); OnHitWall(pEvent); m_bMoveComplete = true; return; } if (m_pEvents[0] is HitRobotEvent) { HitRobotEvent pEvent = (HitRobotEvent)m_pEvents[0]; m_pEvents.Clear(); OnHitRobot(pEvent); m_bMoveComplete = true; return; } if (m_pEvents[0] is ScannedRobotEvent) { ScannedRobotEvent pEvent = (ScannedRobotEvent)m_pEvents[0]; m_pEvents.Clear(); OnScannedRobot(pEvent); return; } if (m_pEvents[0] is BulletMissedEvent) { BulletMissedEvent pEvent = (BulletMissedEvent)m_pEvents[0]; m_pEvents.Clear(); OnBulletMissed(pEvent); return; } if (m_pEvents[0] is BulletHitEvent) { BulletHitEvent pEvent = (BulletHitEvent)m_pEvents[0]; m_pEvents.Clear(); OnBulletHit(pEvent); return; } if (m_pEvents[0] is HitByBulletEvent) { HitByBulletEvent pEvent = (HitByBulletEvent)m_pEvents[0]; m_pEvents.Clear(); OnHitByBullet(pEvent); return; } } }
public override void OnHitWall(HitWallEvent evnt) { hitBullet++; if (hitBullet == 3) { hitBullet = 0; Ahead(180); Back(80); } }
public override void OnHitWall(HitWallEvent e) { if (Y > BattleFieldHeight * 0.5 && X > BattleFieldWidth * 0.5 || Y < BattleFieldHeight * 0.5 && X < BattleFieldWidth * 0.5) { TurnLeft(90); } else { TurnRight(90); } PreviousState = State; State = State.Wall; }
/* * public override void OnPaint(IGraphics g) * { * Point currentPos = new Point((int)X, (int)Y); * Target currentTarget = map.getNearestTarget(currentPos); * if ((currentTarget != null)) * { * Point targetPos = currentTarget.estimatePositionAt(Time); * g.setColor(Color.Green); * g.DrawPolygon(((int)((targetPos.x * - (DISTANCE_TO_ENEMY - DELTA_DISTANCE)))), ((int)((targetPos.y * - (DISTANCE_TO_ENEMY - DELTA_DISTANCE)))), (((int)((DISTANCE_TO_ENEMY - DELTA_DISTANCE))) * 2), (((int)((DISTANCE_TO_ENEMY - DELTA_DISTANCE))) * 2)); * g.drawOval(((int)((targetPos.x * - (DISTANCE_TO_ENEMY + DELTA_DISTANCE)))), ((int)((targetPos.y * - (DISTANCE_TO_ENEMY + DELTA_DISTANCE)))), (((int)((DISTANCE_TO_ENEMY + DELTA_DISTANCE))) * 2), (((int)((DISTANCE_TO_ENEMY + DELTA_DISTANCE))) * 2)); * } * * foreach (Target target in map.targets) * { * // Paint last seen position of target: * g.setColor(Color.orange); * g.drawOval(((int)((target.lastCoords().x - 25))), ((int)((target.lastCoords().y - 25))), 50, 50); * // Paint estimated position of target: * Point p = target.estimatePositionAt(getTime()); * g.setColor(Color.blue); * g.drawOval(((int)((p.x - 25))), ((int)((p.y - 25))), 50, 50); * } * * }*/ public override void OnHitWall(HitWallEvent e) { MaxTurnRate = Rules.MAX_TURN_RATE; double turning = ((PI / 2) - Math.Abs(e.BearingRadians)); if ((e.BearingRadians > 0)) { TurnRightRadians(turning); } else { TurnLeftRadians(turning); } Back(25); //doNothing(); }
/// <summary> /// zdarzenie uderzenia w ścianę /// </summary> /// <param name="evnt"></param> public override void OnHitWall(HitWallEvent e) { _IS_TARGET = false; //określa czy trzeba spod ściany odjechać przodem czy tyłem if ((e.Bearing >= -90 && e.Bearing <= 0) || (e.Bearing >= 0 && e.Bearing <= 90)) { Back(200); } else { Ahead(200); } TurnRight(15); //todo: rozwiązać problem, że jak do tyłu jest od razu ściana to sprobuje potem do przodu jechać (bo tak to sie moze zaklinować) //Back(300); }
public void OnHitWall(HitWallEvent evnt) { count(evnt); }
public override void OnHitWall(HitWallEvent e) { // Move away from the wall VelocityRate = (-1 * VelocityRate); }
/// <summary> /// Hij botst tegen een muur /// </summary> public override void OnHitWall(HitWallEvent e) { BhvReverse.Tick(); }
public void OnHitWall(HitWallEvent e) { moveDirection *= -1; }
public override void OnHitWall(HitWallEvent evnt) { blackBoard.hitsWall = true; }
public override void OnHitWall(HitWallEvent e) { // Move away from the wall //VelocityRate = (-1 * VelocityRate); //SetTurnRight(30); }
public virtual void OnHitWall(HitWallEvent e) { }
public override void OnHitWall(HitWallEvent evento) { //Movimentação do robô caso haja colizão com a parede Back(150); TurnRight(50); }
public override void OnHitWall(HitWallEvent evnt) { SetBack(100); SetTurnLeft(90); Execute(); }
public override void OnHitWall(HitWallEvent e) { Console.WriteLine("F*****g wall got in Johnny5's way"); }
public override void OnHitWall(HitWallEvent evnt) { base.OnHitWall(evnt); blackBoard.MovementDirection *= -1; }
public override void OnHitWall(HitWallEvent e) { SetTurnRight(e.Bearing + 90); SetAhead(50); _direction = -_direction; }
public override void OnHitWall(HitWallEvent evnt) { operations.Direction = -operations.Direction; base.OnHitWall(evnt); }
public override void OnHitWall(HitWallEvent e) { // when the radar is turned here, at least another robot should be Scanned // but Event should not be dispatched because we are in handler with higher priority TurnRadarRight(360); }
public override void OnHitWall(HitWallEvent e) { IsInterruptible = (true); // make sure that the Event handler can be interrupted and restarted TurnRadarRight(360); // when the radar is turned here, at least another robot should be Scanned }
public override void OnHitWall(HitWallEvent evnt) { base.OnHitWall(evnt); }
/// <summary> /// onHitWall: Handle collision with wall. /// </summary> public override void OnHitWall(HitWallEvent e) { // Bounce off! reverseDirection(); }
public override void OnHitWall(HitWallEvent evnt) { SetTurnRight(180); }
//O que fazer quando você atingir uma parede public override void OnHitWall(HitWallEvent e) { Back(30); Ahead(20); }
protected virtual void OnHitWall(HitWallEvent e) {}