Exemplo n.º 1
0
        protected override void Initialize()
        {
            //Resource Managers
            FontMgr = new ResourceManager<SpriteFont>(this);
            TextureMgr = new ResourceManager<Texture2D>(this);
            MusicMgr = new ResourceManager<Song>(this);
            SfxMgr = new ResourceManager<SoundEffect>(this);

            LoadAssets();

            FpsHandler = new FpsCounter(this, FPS_INTERVAL);
            InputMgr = new InputManager(this);

            Player = new Player(this, new Vector2(100.0f, 100.0f));
            Level = new Level(this, "testlvl");
            Camera = new Camera(this);
            LevelMusic = MusicMgr.Find("song1");
            //MediaPlayer.Play(LevelMusic);
            MediaPlayer.Volume = 0.5f;
            //Enemies = new List<Enemy>();
            //Enemies.Add(new Enemy(this, new Vector2(200.0f, 300.0f), 75.0f, 100, 10));
            EnemySpawner = new EnemySpawner(this, 100, true, 1.0f, new Vector2(200.0f, 300.0f));
            Pickables = new List<Pickable>();
            Pickables.Add(new GunPickable(this, new Vector2(300.0f, 300.0f), "Shotgun"));
            Pickables.Add(new GunPickable(this, new Vector2(350.0f, 300.0f), "SMG"));
            Pickables.Add(new GunPickable(this, new Vector2(400.0f, 300.0f), "Shotgun"));

            FpsDisplayer = new FpsDisplay(this, "Arial14");
            FpsDisplayer.Enabled = false; //We don't want the FPS to be shown as default
            FpsDisplayer.Initialize();

            HUD = new HUD(this, "Arial14");
            HUD.Initialize();

            Components.Add(FpsHandler);
            Components.Add(InputMgr);
            Components.Add(Level);
            Components.Add(Player);
            Components.Add(EnemySpawner);
            Components.Add(Camera);

            base.Initialize();
        }
Exemplo n.º 2
0
        protected override void Initialize()
        {
            //Resource Managers
            FontMgr = new ResourceManager<SpriteFont>(this);
            TextureMgr = new ResourceManager<Texture2D>(this);
            MusicMgr = new ResourceManager<Song>(this);
            SfxMgr = new ResourceManager<SoundEffect>(this);

            LoadAssets();

            FpsHandler = new FpsCounter(this, FPS_INTERVAL);
            InputMgr = new InputManager(this);
            //FpsDisplayer = new FpsDisplay(this, "Arial14");

            Player = new Player(this, new Vector2(100.0f, 100.0f));
            Gun = new Gun(this, new Vector2(100.0f, 100.0f));
            Level = new Level(this, "testlvl");
            Camera = new Camera(this);
            Monolith = new Sprite(this, "Monolith", new Vector2(200.0f, 200.0f), 0.0f);

            Components.Add(FpsHandler);
            Components.Add(InputMgr);
            //Components.Add(FpsDisplayer);
            Components.Add(Level);
            Components.Add(Player);
            Components.Add(Gun);
            Components.Add(Camera);
            Components.Add(Monolith);

            base.Initialize();
        }