Esempio n. 1
0
        public NosamGame()
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth       = screenWidth;
            graphics.PreferredBackBufferHeight      = screenHeight;
            graphics.SynchronizeWithVerticalRetrace = true;

            device = graphics.GraphicsDevice;

            Mouse.WindowHandle  = Window.Handle;
            this.IsMouseVisible = true;

            Content.RootDirectory = "Content";

            ScreenRectangle = new Rectangle(0, 0, screenWidth, screenHeight);

            Components.Add(new InputHandler(this));

            stateManager = new GameStateManager(this);
            Components.Add(stateManager);

            StartMenuScreen = new StartMenuScreen(this, stateManager);
            NewGameScreen   = new NewGameScreen(this, stateManager);
            LevelScreen     = new LevelScreen(this, stateManager);

            stateManager.ChangeState(StartMenuScreen);

            this.IsFixedTimeStep = false;
            graphics.SynchronizeWithVerticalRetrace = false;
        }
Esempio n. 2
0
        private void NewGame()
        {
            var newGameScreen = new NewGameScreen();

            newGameScreen.LoadContent();

            var transitionScreen = new FadeTransitionScreen(this, newGameScreen, 0.05f);

            transitionScreen.LoadContent();

            GetComponent <ScreenManager>().SetScreen(transitionScreen);
        }
Esempio n. 3
0
        static void DrawNeeded(int screen, MainMenuScreen MainMenu1, NewGameScreen NewGameMenu1)
        {
            switch (screen)
            {
            case 1:
                MainMenu1.Draw();
                break;

            case 2:
                NewGameMenu1.Draw();
                break;


            default: break;
            }
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            Console.Title = "FillWords by Un1ver5e";
            Console.SetWindowSize(83, 40);
            Console.SetBufferSize(83, 40);
            MainMenuScreen MainMenu1 = new MainMenuScreen();

            InitializeScreen(MainMenu1, 4, 1);
            NewGameScreen NewGameMenu1 = new NewGameScreen();

            InitializeScreen(NewGameMenu1, 2, 2);
            while (true)
            {
                DrawNeeded(activeScreen, MainMenu1, NewGameMenu1);
                ConsoleKey CK = Console.ReadKey(true).Key;
                switch (activeScreen)
                {
                case 1:
                    MainMenu1.Scroll(CK, MainMenu1);
                    if (CK == ConsoleKey.Enter)
                    {
                        ExecuteButtonAction(MainMenu1);
                    }
                    break;

                case 2:
                    NewGameMenu1.Scroll(CK, NewGameMenu1);
                    if (CK == ConsoleKey.Enter)
                    {
                        ExecuteButtonAction(NewGameMenu1);
                    }
                    break;

                default: break;
                }
            }
        }
 public void CloseNewGame()
 {
     NewGameScreen.SetActive(false);
 }
 public void OpenNewGame()
 {
     NewGameScreen.SetActive(true);
 }
Esempio n. 7
0
    public void AddPlayers()
    {
        print($"Setting {numberOfPlayers} up Players");
        players = new List <Player>();

        //one time search so ok
        NewGameScreen newGameScreen = gameControl.ui_Control.newGameScreen;

        if (newGameScreen.included1.activeSelf)
        {
            GameObject player = Instantiate(Player, new Vector3(0f, 0f, 0f), Quaternion.identity);
            player.transform.SetParent(this.transform);
            player.GetComponent <Player>().Init(GlobalVariables.data.PLAYER1_NAME,
                                                GlobalVariables.data.PLAYER_1_START,
                                                GetPlayerColour(GlobalVariables.data.PLAYER1_COLOUR),
                                                GlobalVariables.data.PLAYER_1_CAMERA_DEFAULT);
            players.Add(player.GetComponent <Player>());
        }
        if (newGameScreen.included2.activeSelf)
        {
            GameObject player = Instantiate(Player, new Vector3(0f, 0f, 0f), Quaternion.identity);
            player.transform.SetParent(this.transform);

            Player player2 = player.GetComponent <Player>();

            player2.Init(GlobalVariables.data.PLAYER2_NAME,
                         GlobalVariables.data.PLAYER_2_START,
                         GetPlayerColour(GlobalVariables.data.PLAYER2_COLOUR),
                         GlobalVariables.data.PLAYER_2_CAMERA_DEFAULT);

            //for testing
            newGameScreen.ai2.value = 1;
            ApplyAiIfSet(newGameScreen.ai2, player2);

            players.Add(player2);
        }
        if (newGameScreen.included3.activeSelf)
        {
            GameObject player = Instantiate(Player, new Vector3(0f, 0f, 0f), Quaternion.identity);
            player.transform.SetParent(this.transform);

            Player player3 = player.GetComponent <Player>();

            player3.Init(GlobalVariables.data.PLAYER3_NAME,
                         GlobalVariables.data.PLAYER_3_START,
                         GetPlayerColour(GlobalVariables.data.PLAYER3_COLOUR),
                         GlobalVariables.data.PLAYER_3_CAMERA_DEFAULT);

            //for testing
            newGameScreen.ai3.value = 2;
            ApplyAiIfSet(newGameScreen.ai3, player3);

            players.Add(player3);
        }
        if (newGameScreen.included4.activeSelf)
        {
            GameObject player = Instantiate(Player, new Vector3(0f, 0f, 0f), Quaternion.identity);
            player.transform.SetParent(this.transform);

            Player player4 = player.GetComponent <Player>();

            player4.Init(GlobalVariables.data.PLAYER4_NAME,
                         GlobalVariables.data.PLAYER_4_START,
                         GetPlayerColour(GlobalVariables.data.PLAYER4_COLOUR),
                         GlobalVariables.data.PLAYER_4_CAMERA_DEFAULT);

            //for testing
            newGameScreen.ai4.value = 3;
            ApplyAiIfSet(newGameScreen.ai4, player4);

            players.Add(player4);
        }
        indexOfCurrentPlayer = 0;
        activePlayer         = players.ElementAt(indexOfCurrentPlayer);
    }
Esempio n. 8
0
    //Blue https://en.wikipedia.org/wiki/Stellar_classification

    private void Start()
    {
        NewGameScreen = GameObject.Find("Canvas-SelectionItems").GetComponent <NewGameScreen>();
    }