Ejemplo n.º 1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            player = new PlayerActor(Content.Load <Texture2D>("Textures/mario"), new Point(16, 16), new Point(2, 2));
            player.AddAnimation("IDLE", new Utils.Animation(Point.Zero, new Point(1, 1)));
            player.AddAnimation("WALK", new Utils.Animation(new Point(1, 0), new Point(4, 1), 250));
            player.AddAnimation("RUN", new Utils.Animation(new Point(1, 0), new Point(4, 1), 120));
            player.AddAnimation("JUMP", new Utils.Animation(new Point(5, 0), new Point(6, 1)));
        }