예제 #1
0
        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);
        }
예제 #2
0
 public InactiveState(Mine mine) : base(mine)
 {
     this.Mine._countdown  = TimeSpan.Zero;
     this._animationPlayer = new StaticAnimation(mine, "Sprites/Shot/MineUnarmed");
 }
예제 #3
0
 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));
 }
예제 #5
0
 private void UserControl_LostFocus(object sender, System.Windows.RoutedEventArgs e)
 {
     FocusAnimation.Stop();
     BackToNormal.Begin();
     StaticAnimation.Begin();
 }
예제 #6
0
 private void UserControl_GotFocus(object sender, System.Windows.RoutedEventArgs e)
 {
     StaticAnimation.Stop();
     FocusAnimation.Begin();
 }