Esempio n. 1
0
        public Character(Texture2D image, Vector2 vector, int spriteCount)
        {
            this._posX              = 0;
            this._posY              = 0;
            this._image             = image;
            this._vector            = vector;
            this._spriteSheetWidth  = image.Width;
            this._spriteSheetHeight = image.Height;
            this._spriteCount       = spriteCount;


            Rectangle leftAnimation = Rectangles.GetLeftAnimationDimensions(image.Width, image.Height, spriteCount);

            this._movementRightRectangle = Rectangles.GetRighttAnimationDimensions(image.Width, image.Height, spriteCount);
            this._movementDownRectangle  = Rectangles.GetDownAnimationDimensions(image.Width, image.Height, spriteCount);
            this._movementUpRectangle    = Rectangles.GetUpAnimationDimensions(image.Width, image.Height, spriteCount);

            spriteSheet = new Dictionary <int, Rectangle>();
            spriteSheet.Add((int)SpriteAnimations.LEFT, leftAnimation);
            spriteSheet.Add((int)SpriteAnimations.RIGHT, _movementRightRectangle);
            spriteSheet.Add((int)SpriteAnimations.DOWN, _movementDownRectangle);
            spriteSheet.Add((int)SpriteAnimations.UP, _movementUpRectangle);


            this._spriteCount = 1;
        }