Ejemplo n.º 1
0
        public AnimationHandler(IGameProxy gameProxy, IGraphicsDeviceManager graphicsDeviceManager)
        {
            _game = gameProxy;
            _game.DrawEvent += Draw;
            _game.UpdateEvent += Update;
            _game.LoadContentEvent += LoadContent;

            _barbarianTexture = new AnimatedTexture
                (new AssetValues
                {
                    ContentName = "Barbarian/Walking",
                    FrameCount = 4,
                    Depth = 0.5f,
                    Rotation = 0.0f,
                    Scale = 1.0f,
                    Origin = _shipPos,
                    TimePerFrame = 6.0f
                });
        }
Ejemplo n.º 2
0
        public Barbarian()
        {
            _animationState = AnimationState.Idle;
            _currentPosition = new Vector2 { X = 70, Y = 160 };

            _walkingTexture = new AnimatedTexture
                (new AssetValues
                {
                    ContentName = "Barbarian/Walking",
                    FrameCount = 4,
                    Depth = 0.5f,
                    Rotation = 0.0f,
                    Scale = 1.0f,
                    Origin = _currentPosition,
                    TimePerFrame = 6.0f
                });

            ObjectFactory.Inject<IDrawable>(this);
            ObjectFactory.Inject<IUpdateable>(this);
        }