Esempio n. 1
0
        public Aflevering(Game game)
            : base(game)
        {
            RaceHud      = new RaceHud(this);
            starttime = DateTime.Now;
            //DebugMode = true;

            LoadWorld(@"Content\Aflevering\Worlds\Aflevering.xml");

            Busje = GetGameObject3D("Busje") as Busje;

            PlayerObject    = GetGameObject3D("Busje");
            infoBatch       = new SpriteBatch(game.GraphicsDevice);

            Speed           = Game.Content.Load<SpriteFont>("Aflevering/Fonts/Speed");

            AudioFactory.AddSoundEffect("crash", "Aflevering/Audio/crash");
            AudioFactory.AddSoundEffect("rocket", "Aflevering/Audio/rocket");
            AudioFactory.AddSoundEffect("gasoline", "Aflevering/Audio/benzine");
            AudioFactory.AddSoundEffect("speed1", "Aflevering/Audio/speed1");
            AudioFactory.AddSoundEffect("speed2", "Aflevering/Audio/speed2");
            AudioFactory.AddSoundEffect("speed3", "Aflevering/Audio/speed3");
            AudioFactory.AddSoundEffect("afleveringtheme", "Aflevering/Audio/Race-music2");

            AudioFactory.PlayOnce("afleveringtheme", true);

            //rotate the camera slightly to view the top of the model
            Camera.Rotate(0.0f, 20.0f);

            Mouse.SetPosition(0,0);

            Skybox = new Skybox();

            AddGameObject(Skybox);

            CollissionEvent += new CollissionEventHandler(Aflevering_CollissionEvent);

            string[] textures = { @"Aflevering\Terrain\grass", @"Aflevering\Terrain\sand", @"Aflevering\Terrain\rock", @"Aflevering\Terrain\snow" };
            terrain = new Terrain(game, @"Aflevering\Terrain\bartmap", textures, Camera);
            terrain.Initialize();

            game.IsMouseVisible = true;
        }
Esempio n. 2
0
        public Kantoor3D(Game game)
            : base(game)
        {
            LoadWorld(@"Content\Kantoor3D\Worlds\Kantoor3D.xml");
            WorldBounds = GetGameObject3D("kantoor").TransformedCombinedBoundingBox;

            PlayerObject = new Player();
            AddGameObject(PlayerObject);

            Narrator        = new Narrator(game.GraphicsDevice);
            _spiteBatch       = new SpriteBatch(game.GraphicsDevice);

            ResetMouse();
            _previousMouseState = Mouse.GetState();

            CurrentGameState   = GameStates.KANTOOR;

            this.Hud = new Hud(this);

            Camera.CameraArrived += new CameraArrivedEventHandler(Camera_CameraArrived);
            Camera.Position = new Vector3(1, 4, 10);

            Camera.LockY = true;
            Camera.LockRotationMinDegrees = -40;
            Camera.LockRotationMaxDegrees = 40;
            Camera.LockRotation = true;

            CollissionEvent += new CollissionEventHandler(Kantoor3D_CollissionEvent);
            MouseCollissionHoverEnter += new CollissionEventHandler(Kantoor3D_MouseCollissionHoverEnter);
            MouseCollissionHoverExit += new CollissionEventHandler(Kantoor3D_MouseCollissionHoverExit);
            MouseCollissionClick += new CollissionEventHandler(Kantoor3D_MouseCollissionClick);

            AudioFactory.AddSoundEffect("walk", "Kantoor3D/Audio/walk");
            AudioFactory.AddSoundEffect("door", "Kantoor3D/Audio/door");
            AudioFactory.AddSoundEffect("kantoortheme", "Kantoor3D/Audio/kantoor");

            Instance = this;

            //LoadMiniGame(GetGameObject3D("tafelfotograaf"));
            LoadMiniGame(GetGameObject3D("computerscherm"));
        }