protected override void Update() { //Delete the sword when alarm is over: if (_swordAlarm.IsDone()) { PlayerSword sword = (PlayerSword)ObjectHolder.Objects.Where((obj) => obj.GetType() == typeof(PlayerSword)).ToList()[0]; ObjectHolder.Delete(sword); } base.Update(); }
protected override void Update() { //Move: StepAvoidingWalls(Direction); if (_changeDirection.IsDone()) { TurnRandomDirection(); _changeDirection.Restart(new Random().Next(_changeDirection_bottom, _changeDirection_top)); } if (this.IsColliding(typeof(PlayerSword))) { ObjectHolder.Delete(this); } }