Start() public method

public Start ( ) : void
return void
Esempio n. 1
0
        protected override void LoadContent()
        {
            _spriteBatch     = new SpriteBatch(GraphicsDevice);
            UserInterface.sB = _spriteBatch;
            Graphics.Start();
            HardwareRendering.Start();
            ParticleRendering.Start();
            //start other big components
            Input.Start();

            //load prefabs and scene
            Prefabs.Start();
            UserInterface.Start();
            GameMode.Start();
            SceneManager.Start();

            SceneManager.LoadScene(loadMenu ? "LevelMenu" : "LevelGame");

            Audio.Start();


            PostProcessingManager.Instance.Start(_spriteBatch);

            if (ShowFps)
            {
                _font = File.Load <SpriteFont>("Other/font/debug");
            }

            // add skybox
            //Skybox.Start();
        }
Esempio n. 2
0
    public void SetGameMode(GameMode mode)
    {
        if (currentMode.value != null)
        {
            currentMode.value.Finish(this);
        }

        if (mode != null)
        {
            uiController.SetState(MenuScreenState.None);
            mode.Start(this);
        }

        currentMode.value = mode;
    }
Esempio n. 3
0
    public GameMode instance; // the instance of the game to be initialized


    // Use this for initialization
    void Start()
    {
        uiManager = GetComponent <UIManager>();
        switch (ConfigInfo.currentGameMode)
        {
        // Timed mode
        case Mode.Timed:
        {
            instance = new TimedMode();
            ((TimedMode)instance).Setup(ConfigInfo.playerCount, timedModeTimer);
            break;
        }
        }

        // hook up win event to the display function
        instance.OnWin += DisplayWinner;

        SetupGame();

        // start the round instance
        instance.Start();
    }
Esempio n. 4
0
        public override void ReadScriptMessage(PacketReader stream)
        {
            ScriptMessages id = (ScriptMessages)stream.ReadByte();

            Log.Logger.Log(id);
            switch (id)
            {
            case ScriptMessages.GameInfo:
                ReadGameInfo(stream);
                break;

            case ScriptMessages.DuelRequest:
                DuelMode.ReadRequest(stream);
                break;

            case ScriptMessages.DuelStart:
                DuelMode.ReadStart(stream);
                break;

            case ScriptMessages.DuelWin:
                DuelMode.ReadWin(stream);
                break;

            case ScriptMessages.DuelEnd:
                DuelMode.ReadEnd(stream);
                break;

            case ScriptMessages.ChatMessage:
                Chat.ReadMessage(stream);
                break;

            case ScriptMessages.ChatTeamMessage:
                Chat.ReadTeamMessage(stream);
                break;

            case ScriptMessages.DuelScoreBoard:
                DuelBoardScreen.Instance.ReadMessage(stream);
                break;

            case ScriptMessages.PlayerInfo:
                PlayerInfo.ReadPlayerInfoMessage(stream);
                break;

            case ScriptMessages.PlayerInfoTeam:
                PlayerInfo.ReadPlayerInfoTeam(stream);
                break;

            case ScriptMessages.PlayerQuit:
                PlayerInfo.ReadPlayerQuitMessage(stream);
                break;

            case ScriptMessages.PointsMessage:
                int points = stream.ReadSByte();
                Sumpfkraut.Menus.ScreenScrollText.AddText((points > 0 ? "Punkte +" : "Punkte ") + points);
                break;

            case ScriptMessages.ModeStart:
                GameMode.Start(stream.ReadString());
                break;

            case ScriptMessages.ModePhase:
                GameMode.ReadPhase(stream);
                break;

            case ScriptMessages.TDMScoreBoard:
                TDMScoreBoard.Instance.ReadMessage(stream);
                break;

            case ScriptMessages.TDMWin:
                TDMMode.ReadWinMessage(stream);
                break;

            case ScriptMessages.HordeScoreBoard:
                HordeScoreBoard.Instance.ReadMessage(stream);
                break;

            case ScriptMessages.HordeWin:
                HordeMode.End(true);
                break;

            case ScriptMessages.HordeLoss:
                HordeMode.End(false);
                break;
            }
        }