コード例 #1
0
ファイル: Game1.cs プロジェクト: noogai03sprojects/ZeldaLike
        /// <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
        }
コード例 #2
0
ファイル: Game1.cs プロジェクト: noogai03sprojects/ZeldaLike
        /// <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
        }