Ejemplo n.º 1
0
        public Hero(Texture2D texture, IInputReader reader)
        {
            heroTexture      = texture;
            walkRight        = new WalkRightAnimation(texture, this);
            walkLeft         = new WalkLeftAnimation(texture, this);
            currentAnimation = walkRight;
            //animatie = new Animatie();
            //animatie.AddFrame(new AnimationFrame(new Rectangle(0, 0, 280, 385)));
            //animatie.AddFrame(new AnimationFrame(new Rectangle(280, 0, 280, 385)));
            //animatie.AddFrame(new AnimationFrame(new Rectangle(560, 0, 280, 385)));
            //animatie.AddFrame(new AnimationFrame(new Rectangle(840, 0, 280, 385)));
            //animatie.AddFrame(new AnimationFrame(new Rectangle(1120, 0, 280, 385)));


            //Read input for my hero class
            this.inputReader = reader;
            mouseReader      = new MouseReader();

            moveCommand   = new MoveCommand();
            moveToCommand = new MoveToCommando();

            Position = new Vector2(0, 0);

            _collisionRectangle = new Rectangle((int)Position.X, (int)Position.Y, 280, 385);
        }
Ejemplo n.º 2
0
        public Hero(Texture2D texture, IInputReader inputReader, ICollisionHelper helper)
        {
            this.heroTexture = texture;
            walkRight        = new WalkRightAnimation(texture, this);
            walkLeft         = new WalkLeftAnimation(texture, this);
            walkUp           = new WalkUpAnimation(texture, this);
            walkDown         = new WalkDownAnimation(texture, this);
            currentAnimation = walkDown;

            //Read input for hero class
            this.reader = inputReader;
            moveCommand = new MoveCommand();


            _collisionRectangle  = new Rectangle((int)Position.X, (int)Position.Y, 62, 110);
            this.collisionhelper = helper;
            Position             = new Vector2(65, 340);

            //manager = new CollisionManager(inputReader, helper);
        }