Пример #1
0
        internal static void Main()
        {
            try
            {
                GameConfigurator.Configure();

                log = LogManager.GetLog(nameof(Program));

                var gameWidth  = FontProvider.GetScreenWidth(FontTarget.Game);
                var gameHeight = FontProvider.GetScreenHeight(FontTarget.Game) / 2;
                SadConsole.Game.Create(gameWidth, gameHeight);

                SadConsole.Game.OnInitialize = Init;

                SadConsole.Game.Instance.Run();

                SadConsole.Game.Instance.Dispose();

                log.Info("Closing game");

                CurrentGame.Load(null);

                GC.Collect();

                //throw new GameExitException();
            }
            catch (GameExitException)
            {
                throw;
            }
            catch (Exception e)
            {
                log.Fatal(e);
                throw;
            }
        }
Пример #2
0
        private void OnButtonClickHandler()
        {
            var gameConfigurator = new GameConfigurator(_gameDef, PlayerBallDef);

            GameStatusObserver.StartGame(gameConfigurator);
        }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("DataPath: " + Application.dataPath);
        //System.Diagnostics.Process.Start(Application.dataPath + "/AffectiveLnk_bridge");

        stimulusDeliveryPlane.active = false;
        //stimulusDeliveryPlane.transform.position = new Vector3(stimulusDeliveryPlane.transform.position.x, 1000, stimulusDeliveryPlane.transform.position.z);

        threatCollisionSource = Camera.mainCamera.GetComponent<AudioSource>();

        gameLog = new List<GameLogEntry>();

        if(GameLogic.instance == null)
        {
            GameLogic.instance = this;
        }
        gameState = GameState.menu;

        player = (Player)FindObjectOfType(typeof(Player));
        expTrial = (ExperimentalTrial)FindObjectOfType(typeof(ExperimentalTrial));
        surveyLogic = (SurveyLogic)FindObjectOfType(typeof(SurveyLogic));
        empConnection = (EmpaticaConnection)FindObjectOfType(typeof(EmpaticaConnection));
        gameConfig = (GameConfigurator)FindObjectOfType(typeof(GameConfigurator));

        startPoints = new Vector3[4];

        startPoints[0] = new Vector3(-4,1,3);
        startPoints[1] = new Vector3(4,1,3);
        startPoints[2] = new Vector3(4,1,-3);
        startPoints[3] = new Vector3(-4,1,-3);
    }