Beispiel #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()
        {
            cam    = new Camera2d(Config.Instance.GameWidth, Config.Instance.ScreenWidth, Config.Instance.GameHeight, Config.Instance.ScreenHeight);
            layers = new List <Layer>
            {
                new Layer(cam)
                {
                    Parallax = new Vector2(0.2f, 1.0f)
                },
                new Layer(cam)
                {
                    Parallax = new Vector2(0.3f, 1.0f)
                },
                new Layer(cam)
                {
                    Parallax = new Vector2(0.4f, 1.0f)
                },
                new Layer(cam)
                {
                    Parallax = new Vector2(0.8f, 1.0f)
                },
                new Layer(cam)
                {
                    Parallax = new Vector2(1.0f, 1.0f)
                },
                new Layer(cam)
                {
                    Parallax = new Vector2(1.0f, 1.0f)
                }
            };

            Texture2D test = Content.Load <Texture2D>("new_groundplane");

            layers[0].Sprites.Add(new BackgroundObject {
                texture = Content.Load <Texture2D>("background"), mainFrame = new Rectangle(-100, 0, 2200, Config.Instance.GameHeight)
            });
            layers[1].Sprites.Add(new BackgroundObject {
                texture = Content.Load <Texture2D>(@"main_castle"), mainFrame = new Rectangle(-100, 275, 2200, Config.Instance.GameHeight - 300)
            });
            layers[2].Sprites.Add(new BackgroundObject {
                texture = Content.Load <Texture2D>(@"midground"), mainFrame = new Rectangle(-100, 100, 2200, Config.Instance.GameHeight)
            });
            //layers[3].Sprites.Add(new BackgroundObject { texture = Content.Load<Texture2D>(@"foreground"), mainFrame = new Rectangle(-100, 0, 2200, Config.Instance.GameHeight) });
            layers[4].Sprites.Add(new BackgroundObject {
                texture = Content.Load <Texture2D>(@"new_groundplane"), mainFrame = new Rectangle(500, 0, 2200, Config.Instance.GameHeight)
            });
            //cam.Pos = new Vector2(Config.Instance.GameWidth/2, 360.0f);
            mainFrame = new Rectangle(-150, -450, 2200, Config.Instance.GameHeight);

            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            spriteFont   = Content.Load <SpriteFont>("slant");
            ingameFont   = Content.Load <SpriteFont>("arvil");
            comboManager = new ComboManager(ingameFont);

            BGMManager bgmManager = new BGMManager(Content);

            projectileManager = new ProjectileManager(Content);
            throwManager      = new OneButtonThrowManager();
            superManager      = new BasicSuperManager(cam);
            //background = Content.Load<Texture2D>("background");
            //background2 = Content.Load<Texture2D>("main_castle");

            menuBg = Content.Load <Texture2D>("bg2");

            victoryDots = Content.Load <Texture2D>("winDots");

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

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


            testHitbox = new Rectangle(100, 100, 100, 100);

            testHitInfo = new HitInfo(3, 20, Hitzone.HIGH);
            testHitInfo.IsHardKnockDown = true;
            testHitInfo.AirUntechTime   = 8000;
            testHitInfo.AirXVelocity    = 80;
            testHitInfo.AirYVelocity    = 2;

            effect = Content.Load <SoundEffect>("hit_3");
            hit2   = Content.Load <SoundEffect>("hit_4");
            slash  = Content.Load <SoundEffect>("stab_1");
            slash2 = Content.Load <SoundEffect>("stab_2");
            strum  = Content.Load <SoundEffect>("strum_1");

            //MediaPlayer.Play(bgmManager.getRandomBGM());
            //MediaPlayer.Volume = 0.4f;

            player1Controls.setControl("down", Keys.Down);
            player1Controls.setControl("right", Keys.Right);
            player1Controls.setControl("left", Keys.Left);
            player1Controls.setControl("up", Keys.Up);
            player1Controls.setControl("a", Keys.A);
            player1Controls.setControl("b", Keys.S);
            player1Controls.setControl("c", Keys.D);
            player1Controls.setControl("d", Keys.Z);
            player1Controls.setControl("start", Keys.Enter);

            player2Controls.setControl("down", Keys.K);
            player2Controls.setControl("right", Keys.L);
            player2Controls.setControl("left", Keys.J);
            player2Controls.setControl("up", Keys.I);
            player2Controls.setControl("a", Keys.F);
            player2Controls.setControl("b", Keys.G);
            player2Controls.setControl("c", Keys.H);
            player2Controls.setControl("d", Keys.V);
            player2Controls.setControl("start", Keys.End);

            characterSelection = new CharacterSelectList(Content);
            gameState          = GameState.MAINMENU;
            player1CharacterId = "LongSword";

            player2CharacterId = "HuntingHorn";

            pauseMenu = new PauseMenu(spriteFont);

            pressStart = Content.Load <Texture2D>("press_start");
            mainMenu   = new MainMenu(spriteFont, pressStart);

            titleScreen   = Content.Load <Texture2D>("Rising_Force_Title");
            loadingScreen = Content.Load <Texture2D>("VS_Screen");
            demoEndScreen = Content.Load <Texture2D>("thank_you");

            player1NamePlate = Content.Load <Texture2D>("Liara_game_text");
            player2NamePlate = Content.Load <Texture2D>("Aydin_game_text");
        }