Ejemplo n.º 1
0
        public override void UpdateGameplay(float elapsedTime)
        {
            MusicManager.play(MusicManager.ShipMusic);

            AquaticPhysics.Instance.DynamicsWorld.StepSimulation(GameModel.GlobalElapsedTime);
            Cheats.ApplyCheats(this.GameState.character);
            this.GameState.character.UpdateStats(new Stats(elapsedTime * this.GameState.character.MaxStats.Oxygen / 3, 0));
            inventoryScene.Update(elapsedTime);
            craftingScene.Update(elapsedTime);
            selectableThings.ForEach(TellIfCameraIsLookingAtThing);

            GameState.character.Update(Camera);

            dialogBox.Update(elapsedTime);
            ShaderRepository.ShipAmbientShader.SetValue("time", elapsedTime);
        }
Ejemplo n.º 2
0
        public override void UpdateGameplay(float elapsedTime)
        {
            Game.cameraPosition = Camera.Position;
            if (!loaded)
            {
                if (this.loading)
                {
                    return;
                }

                preload();

                //TODO loading scene

                this.loading = true;

                return;
            }

            if (this.GameState.character.IsDead())
            {
                onGameOverCallback();
            }

            MusicManager.play(this.Camera.Position.Y > 0 ? MusicManager.SurfaceMusic : MusicManager.UnderWaterMusic);

            Cheats.ApplyCheats(this.GameState.character);

            World.Update(Camera, GameState.character);

            CharacterUpdate(elapsedTime);

            //skyBoxUnderwater.Center = new TGCVector3(Camera.Position.X, skyBoxUnderwater.Center.Y, Camera.Position.Z);
            //skyBoxOutside.Center = new TGCVector3(Camera.Position.X, skyBoxOutside.Center.Y, Camera.Position.Z);
            theSkybox.position = Camera.Position;
            //waterSurface.position = new Microsoft.DirectX.Vector3(Camera.Position.X, 0, Camera.Position.Z);
            waterSurface.Update(elapsedTime);

            inventoryScene.Update(elapsedTime);
            aimFired = false;

            orientationArrow.Update(Camera.Position, InitialChunk.ShipInitialPosition, Camera.LookAt);
            dialogBox.Update(elapsedTime);
            waterSurface.position = new Microsoft.DirectX.Vector3(Camera.Position.X, waterSurface.position.Y, Camera.Position.Z);
        }