Exemple #1
0
        public Narrator(GraphicsDevice graphicsDevice)
        {
            PlacementOffset = Vector2.Zero;

            narratorModel = SeriousGameLib.GameObject.Content.Load<Model>("Hud/narrator");

            _transparant         = Color.White;
            _position            = new Vector2();
            _graphicsDevice      = graphicsDevice;
            _defaultFont         = SeriousGameLib.GameObject.Content.Load<SpriteFont>("Hud/Fonts/NarratorFont");
            _narratorDolphin     = SeriousGameLib.GameObject.Content.Load<Texture2D>("Hud/dolphin");
            _defaultFont.LineSpacing = 25; // So why cant I do this via XML?

            _balloonTop          = SeriousGameLib.GameObject.Content.Load<Texture2D>("Hud/Balloon/BalloonTop");
            _balloonBottom       = SeriousGameLib.GameObject.Content.Load<Texture2D>("Hud/Balloon/BalloonBottom");
            _balloonLeft         = SeriousGameLib.GameObject.Content.Load<Texture2D>("Hud/Balloon/BalloonLeft");
            _balloonRight        = SeriousGameLib.GameObject.Content.Load<Texture2D>("Hud/Balloon/BalloonRight");
            _balloonTopLeft      = SeriousGameLib.GameObject.Content.Load<Texture2D>("Hud/Balloon/BalloonTopLeft");
            _balloonTopRight     = SeriousGameLib.GameObject.Content.Load<Texture2D>("Hud/Balloon/BalloonTopRight");
            _balloonBottomLeft   = SeriousGameLib.GameObject.Content.Load<Texture2D>("Hud/Balloon/BalloonBottomLeft");
            _balloonBottomRight  = SeriousGameLib.GameObject.Content.Load<Texture2D>("Hud/Balloon/BalloonBottomRight");
            _balloonCenter       = SeriousGameLib.GameObject.Content.Load<Texture2D>("Hud/Balloon/BalloonCenter");
            _balloonArrow        = SeriousGameLib.GameObject.Content.Load<Texture2D>("Hud/Balloon/BalloonArrow");

            Instance             = this;

            _currentMouseState = _previousMouseState = Mouse.GetState();

            _buttons = new Dictionary<string, Button>();

            Hide();
        }
Exemple #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"));
        }