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);

            player.AddComponent(new Sprite(Content.Load<Texture2D>("linkSheet.png"), new Vector2(10, 10)));

            AnimationController controller = new AnimationController();
            player.AddComponent(controller);

            PlayerInput input = (PlayerInput)player.AddComponent(new PlayerInput());

            controller.LoadAnimation("json\\walk_down.json");
            controller.LoadAnimation("json\\walk_side.json");
            controller.LoadAnimation("json\\walk_up.json");
            controller.LoadAnimation("json\\stand.json");
            controller.Initialize();
            input.Awake();

            //mapManager.LoadMap("Content\\maps\\map1", Content);

            // TODO: use this.Content to load your game content here
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Called internally.
 /// </summary>
 /// <param name="_object"></param>
 public override void Initialize(GameObject _object)
 {
     base.Initialize(_object);
     animController = GetComponent<AnimationController>();
     sprite = GetComponent<Sprite>();
     PlayerDirection = Direction.Down;
     State = PlayerState.Standing;
     inputs = new HashSet<Input>();
     lastInputs = new HashSet<Input>();
 }
Ejemplo n.º 3
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);

            gameObject.AddComponent(new Sprite(Content.Load<Texture2D>("linkSheet.png"), new Vector2(10, 10)));
            gameObject.AddComponent(new PlayerInput());

            AnimationController controller = new AnimationController();
            gameObject.AddComponent(controller);

            controller.LoadAnimation("..\\..\\..\\..\\ZeldaStyle\\Content\\json\\walk_side.json", false);
            //controller.LoadAnimation("json\\walk_side.json");
            controller.Initialize();
            controller.SwitchAnimation("walk_side");

            // TODO: use this.Content to load your game content here
        }