コード例 #1
0
        /// <summary>Construct an instance.</summary>
        /// <param name="LeftSprite">Left animated sprite for this piece.</param>
        /// <param name="RightSprite">Right animated sprite for this piece.</param>
        /// <param name="UpSprite">Up animated sprite for this piece.</param>
        /// <param name="DownSprite">Down animated sprite for this piece.</param>
        /// <param name="startingSpriteDirection">The sprite's initial facing direction.</param>
        public AnimatedSpriteCollection(AnimatedSpriteExtended LeftSprite, AnimatedSpriteExtended RightSprite, AnimatedSpriteExtended UpSprite, AnimatedSpriteExtended DownSprite, Direction startingSpriteDirection)
        {
            this.leftSprite  = LeftSprite;
            this.rightSprite = RightSprite;
            this.upSprite    = UpSprite;
            this.downSprite  = DownSprite;
            switch (startingSpriteDirection)
            {
            case Direction.down:
                this.setDown();
                break;

            case Direction.left:
                this.setLeft();
                break;

            case Direction.right:
                this.setRight();
                break;

            case Direction.up:
                this.setUp();
                break;
            }
        }
コード例 #2
0
 /// <summary>Sets the current sprite direction to face up.</summary>
 public void setUp()
 {
     this.currentSprite = this.upSprite;
 }
コード例 #3
0
 /// <summary>Sets the current sprite direction to face down.</summary>
 public void setDown()
 {
     this.currentSprite = this.downSprite;
 }
コード例 #4
0
 /// <summary>Sets the current sprite direction to face right.</summary>
 public void setRight()
 {
     this.currentSprite = this.rightSprite;
 }
コード例 #5
0
 /// <summary>Sets the current sprite direction to face left.</summary>
 public void setLeft()
 {
     this.currentSprite = this.leftSprite;
 }