public override void Update(GameTime gameTime) { if (Vector2.Distance(ParentShip.Position, Target) <= 25.0f) { ParentShip.StopMovement(); Parent.SetState <ShipIdleState>(); } }
public override void Update(GameTime gameTime) { if (Vector2.Distance(ParentShip.Position, Target.Position + RandomOffset) <= 50) { ParentShip.StopMovement(); Parent.SetState <MinerDepositingState>(); } else { ParentShip.SetDestination(Target.Position + RandomOffset); } }
public override void Update(GameTime gameTime) { if (ParentShip.CollisionRect.Intersects(Target.CollisionRect)) { ParentShip.StopMovement(); Parent.GetState <MinerMiningState>().Target = Target; Parent.SetState <MinerMiningState>(); } else { ParentShip.SetDestination(Target.Position); } }
public override void Update(GameTime gameTime) { if (Vector2.Distance(ParentShip.Position, Target.Position + RandomOffset) <= 50) { ParentShip.StopMovement(); Parent.GetState <MinerMiningState>().Target = Target; Parent.SetState <MinerMiningState>(); GameplayState.EffectsManager.AddExplosion(Target.Position + RandomOffset, Color.OrangeRed, 1.0f, 3000); } else { ParentShip.SetDestination(Target.Position + RandomOffset); } }
public override void Update(GameTime gameTime) { if (Vector2.Distance(Target.Position + RandomOffset, ParentShip.Position) <= FollowDistance) { if (Target.IsMoving) { ParentShip.MoveSpeed = Target.MoveSpeed; ParentShip.SetDestination(Target.Position + RandomOffset); } else { ParentShip.StopMovement(); } } else { ParentShip.MoveSpeed = ParentShip.BaseMoveSpeed; ParentShip.SetDestination(Target.Position + RandomOffset); } }
public override void Update(GameTime gameTime) { if (Vector2.Distance(Target.Position, ParentShip.Position) <= FollowDistance) { ParentShip.StopMovement(); Waiting = true; } else { if (Waiting) { if (Vector2.Distance(Target.Position, ParentShip.Position) >= FollowDistance * 2) { Waiting = false; } } else { ParentShip.SetDestination(Target.Position); } } }
public override void Update(GameTime gameTime) { if (Vector2.Distance(Target.Position, ParentShip.Position) <= FollowDistance) { if (Target.IsMoving) { ParentShip.MoveSpeed = Target.MoveSpeed; ParentShip.SetDestination(Target.Position); } else { ParentShip.StopMovement(); } Target.RepairArmour(RepairRate * gameTime.DeltaTime()); } else { ParentShip.MoveSpeed = ParentShip.BaseMoveSpeed; ParentShip.SetDestination(Target.Position); } }
public override void Begin() { ParentShip.StopMovement(); }