Esempio n. 1
0
        public override void OnInitialise()
        {
            GameSimRules rules = new GameSimRules();

            rules.FragWinLimit  = 20;
            rules.RespawnTime   = 5;
            rules.GameTimeLimit = 300;

            var gameSim = new GameSimulation(rules);

            SystemCore.AddNewUpdateRenderSubsystem(gameSim);
            SystemCore.CursorVisible = true;
            SystemCore.ActiveScene.SetUpBasicAmbientAndKey();
            SystemCore.ActiveScene.FogEnabled = false;


            cameraObject = new GameObject();
            cameraObject.AddComponent(new ComponentCamera(MathHelper.PiOver4, SystemCore.GraphicsDevice.Viewport.AspectRatio, 1f, 200f, false));
            SystemCore.GameObjectManager.AddAndInitialiseGameObject(cameraObject);
            SystemCore.SetActiveCamera(cameraObject.GetComponent <ComponentCamera>());
            cameraObject.Transform.AbsoluteTransform = Matrix.CreateWorld(new Vector3(0, 180, 0), new Vector3(0, -1, 0), new Vector3(0, 0, 1));


            host = WebHostHelper.CreateWebHost(gameSim);

            gameSim.CreateTrainingArena(10, 10, 10);


            gameSim.TrainingMode = true;


            base.OnInitialise();
        }