Ejemplo n.º 1
0
        /// <summary>
        /// //Creates all the classes for the mainmenu and adds them to the proper lists
        /// </summary>
        /// <param name="gameObjects"></param>
        ///
        private void Createmainmenu(List <GameObject> gameObjects)
        {
            MenuButton CreateServer = new MenuButton(game, SpriteManager.AddSprite(Textures.MenuButtonTexture1), 1);

            gameObjects.Add(CreateServer);
            menubuttons.Add(CreateServer);
            CreateServer.Sprite.Position.Y += 120;
            MenuButton JoinServer = new MenuButton(game, SpriteManager.AddSprite(Textures.MenuButtonTexture2), 2);

            gameObjects.Add(JoinServer);
            menubuttons.Add(JoinServer);
            screentype = Screentype.Main;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a gamescreen and adds it to the proper list
        /// </summary>
        /// <param name="gameObjects"></param>
        /// <param name="ip"></param>
        //public void Creategamescreen(List<GameObject> gameObjects, string ip)
        //{
        //    this.Kill(gameObjects);
        //    multiplayerarena1 = new Gamescreen(game, null, gameObjects, ip);
        //    gameObjects.Add(multiplayerarena1);

        //    if (multiplayerarena1.Stop)
        //    {
        //        gameObjects.Remove(multiplayerarena1);
        //        Createmainmenu(gameObjects);
        //    }
        //    else gameObjects.Remove(this);
        //}

        /// <summary>
        /// Should create all the classes needed for a joinscreen and add them to the proper lists
        /// </summary>
        /// <param name="gameObjects"></param>
        public void CreateJoinScreen(List <GameObject> gameObjects) //FIX
        {
            //JoinGameScreen joinScreen = new JoinGameScreen(game, null, gameObjects, this);
            //gameObjects.Add(joinScreen);
            this.Kill(gameObjects);
            ipbox                = new TextBox(0, 0, 20);
            ipbox.Selected       = true;
            prompter             = FlatRedBall.Graphics.TextManager.AddText("Enter the IP of the server you wish to join");
            prompter.Position.Y += 140;
            prompter.Position.X -= 100;
            GlobalData.GlobalData.keyboardDispatcher.Subscriber = ipbox;
            screentype = Screentype.Join;
        }