Exemple #1
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            Texture2D blankTexture = new Texture2D(GraphicsDevice, 1, 1);

            blankTexture.SetData(new[] { Color.White });

            this.textures.Add("player", Content.Load <Texture2D>("player"));
            this.textures.Add("bloc", Content.Load <Texture2D>("bloc_tile"));
            this.textures.Add("bullet", Content.Load <Texture2D>("bullet"));
            this.textures.Add("grass", Content.Load <Texture2D>("grass_tile"));
            this.textures.Add("background", Content.Load <Texture2D>("background"));
            this.textures.Add("blank", blankTexture);

            this.textures.Add("knight_run_01", Content.Load <Texture2D>("knight_run_01"));
            this.textures.Add("knight_run_02", Content.Load <Texture2D>("knight_run_02"));
            this.textures.Add("knight_run_03", Content.Load <Texture2D>("knight_run_03"));
            this.textures.Add("knight_run_04", Content.Load <Texture2D>("knight_run_04"));
            this.textures.Add("knight_run_05", Content.Load <Texture2D>("knight_run_05"));
            this.textures.Add("knight_run_06", Content.Load <Texture2D>("knight_run_06"));
            this.textures.Add("knight_run_07", Content.Load <Texture2D>("knight_run_07"));

            this.textures.Add("knight_idle_01", Content.Load <Texture2D>("knight_idle_01"));
            this.textures.Add("knight_idle_02", Content.Load <Texture2D>("knight_idle_02"));
            this.textures.Add("knight_idle_03", Content.Load <Texture2D>("knight_idle_03"));
            this.textures.Add("knight_idle_04", Content.Load <Texture2D>("knight_idle_04"));
            this.textures.Add("knight_idle_05", Content.Load <Texture2D>("knight_idle_05"));
            this.textures.Add("knight_idle_06", Content.Load <Texture2D>("knight_idle_06"));
            this.textures.Add("knight_idle_07", Content.Load <Texture2D>("knight_idle_07"));

            this.textures.Add("knight_attack_01", Content.Load <Texture2D>("knight_attack_01"));
            this.textures.Add("knight_attack_02", Content.Load <Texture2D>("knight_attack_02"));
            this.textures.Add("knight_attack_03", Content.Load <Texture2D>("knight_attack_03"));
            this.textures.Add("knight_attack_04", Content.Load <Texture2D>("knight_attack_04"));
            this.textures.Add("knight_attack_05", Content.Load <Texture2D>("knight_attack_05"));
            this.textures.Add("knight_attack_06", Content.Load <Texture2D>("knight_attack_06"));
            this.textures.Add("knight_attack_07", Content.Load <Texture2D>("knight_attack_07"));

            this.fonts.Add("debug", Content.Load <SpriteFont>("debug"));



            PhysicsEngine.GetInstance().Init();
            GraphicsEngine.GetInstance().Init(this.textures, this.fonts, this.windowHeight, this.windowWidth);

            this.world = new World();
        }