public StandardShot(Vector2 position, Direction direction, int energy, IGameObject originator) : base(position) { if (direction == Direction.None) { throw new ArgumentOutOfRangeException(nameof(direction)); } this.Energy = energy; this.Originator = originator; this._directionOfTravel = direction; this.Orientation = direction.Orientation(); string textureName = originator is Player ? "Sprites/Shot/RedShot" : "Sprites/Shot/GreenShot"; this._animationPlayer = new StaticAnimation(this, textureName); ResetTimeToTravel(true); this._boundingRectangles = GetBoundingRectangles(); this.MovementBoundary = GlobalServices.BoundMovementFactory.GetWorldBoundary(); this.Properties.Set(GameObjectProperties.Capability, ObjectCapability.CanPushOthers); this.Properties.Set(GameObjectProperties.DrawOrder, (int)SpriteDrawOrder.Shot); }
public InactiveState(Mine mine) : base(mine) { this.Mine._countdown = TimeSpan.Zero; this._animationPlayer = new StaticAnimation(mine, "Sprites/Shot/MineUnarmed"); }
public Grave(Vector2 position) : base(position) { this.Energy = 255; this._animationPlayer = new StaticAnimation(this, "Sprites/Props/Grave"); this.Properties.Set(GameObjectProperties.DrawOrder, (int)SpriteDrawOrder.StaticItem); }
public virtual void QueueAnimation(StaticAnimation animation, int duration = 800, int interval = 200) { Task.Run(() => Animate(animation, duration, interval)); }
private void UserControl_LostFocus(object sender, System.Windows.RoutedEventArgs e) { FocusAnimation.Stop(); BackToNormal.Begin(); StaticAnimation.Begin(); }
private void UserControl_GotFocus(object sender, System.Windows.RoutedEventArgs e) { StaticAnimation.Stop(); FocusAnimation.Begin(); }