Esempio n. 1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (ShooterGame game = new ShooterGame())
     {
         game.Run();
     }
 }
Esempio n. 2
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (ShooterGame game = new ShooterGame())
     {
         game.Run();
     }
 }
Esempio n. 3
0
 public GameDataManager(ShooterGame game)
 {
     //Test code: to be replaced.
     DefaultButtonFrame = new UIDynamicSprite(game.Content.Load <Texture2D>("Frame.png"), 8);
     DefaultWindowFrame = new UIWindowDynamicSprite(game.Content.Load <Texture2D>("Frame.png"), 8, 4);
     DefaultFont        = game.Content.Load <SpriteFont>("DefaultFont12");
     PlayerTexture      = game.Content.Load <Texture2D>("Player.png");
     ShotTexture        = game.Content.Load <Texture2D>("Shot.png");
 }
Esempio n. 4
0
        public ClientReadyRoomGameState(ShooterGame game)
            : base(game)
        {
            Game   = game;
            Client = (NetClient)game.NetPeer;
            UIButtonDynamic backButton = new UIButtonDynamic(100, 100, 200, 20, Back, game.Data.DefaultButtonFrame, game.Data.DefaultFont, "Back");

            UI.Add(backButton);
        }
Esempio n. 5
0
        public MainMenuGameState(ShooterGame game)
            : base(game)
        {
            Game = game;
            UIButtonDynamic joinButton = new UIButtonDynamic(100, 100, 200, 20, JoinGame, game.Data.DefaultButtonFrame, game.Data.DefaultFont, "Join Game");
            UIButtonDynamic hostButton = new UIButtonDynamic(100, 130, 200, 20, HostGame, game.Data.DefaultButtonFrame, game.Data.DefaultFont, "Host Game");
            UIButtonDynamic exitButton = new UIButtonDynamic(100, 160, 200, 20, game.Exit, game.Data.DefaultButtonFrame, game.Data.DefaultFont, "Exit");

            UI.Add(joinButton, hostButton, exitButton);
        }
Esempio n. 6
0
        public ServerReadyRoomGameState(ShooterGame game, string serverName, string serverPassword)
            : base(game)
        {
            Game           = game;
            ServerName     = serverName;
            ServerPassword = serverPassword;
            UIButtonDynamic startButton = new UIButtonDynamic(100, 100, 200, 20, Start, game.Data.DefaultButtonFrame, game.Data.DefaultFont, "Start");
            UIButtonDynamic backButton  = new UIButtonDynamic(100, 130, 200, 20, Back, game.Data.DefaultButtonFrame, game.Data.DefaultFont, "Back");

            Connections = new UIText(350, 100, 1000, 1000, game.Data.DefaultFont, Color.White, "Connections: 0");
            UI.Add(startButton, backButton, Connections);
        }
Esempio n. 7
0
        public BattleGameState(ShooterGame game)
            : base(game)
        {
            Game    = game;
            Map     = new GameMap();
            MapView = new GameMapView(this);
            UIViewport mapViewport = new UIViewport(0, 0, UI.Width, UI.Height, MapView, game);

            mapViewport.IsAlwaysAtBottom = true;

            UI.Add(mapViewport);
        }
Esempio n. 8
0
        public ClientLobbyGameState(ShooterGame game)
            : base(game)
        {
            Game = game;
            UIButtonDynamic refreshButton   = new UIButtonDynamic(100, 100, 200, 20, Refresh, game.Data.DefaultButtonFrame, game.Data.DefaultFont, "Refresh");
            UIButtonDynamic connectButton   = new UIButtonDynamic(100, 130, 200, 20, Connect, game.Data.DefaultButtonFrame, game.Data.DefaultFont, "Connect");
            UIButtonDynamic backButton      = new UIButtonDynamic(100, 160, 200, 20, Back, game.Data.DefaultButtonFrame, game.Data.DefaultFont, "Back");
            UIText          playerNameLabel = new UITextBox(350, 100, 200, 20, game.Data.DefaultFont, Color.White, "Player Name: ");

            PlayerName = new UITextBox(550, 100, 1000, 20, game.Data.DefaultFont, Color.White, "Test Player", 32);
            PlayerName.TakesFocusOnMouseAction = true;
            ServerList        = new UIText(350, 130, 1000, 1000, game.Data.DefaultFont, Color.White);
            ServerList.String = "Server list: \n";
            UI.Add(refreshButton, connectButton, backButton, playerNameLabel, PlayerName, ServerList);
        }
Esempio n. 9
0
        public ServerCreationGameState(ShooterGame game)
            : base(game)
        {
            Game = game;
            UIText serverNameLabel = new UIText(350, 100, 200, 20, game.Data.DefaultFont, Color.White, "Server Name: ");

            ServerName = new UITextBox(550, 100, 800, 20, game.Data.DefaultFont, Color.White, "Test Server", 64);
            ServerName.TakesFocusOnMouseAction = true;
            UIText serverPasswordLabel = new UIText(350, 130, 200, 20, game.Data.DefaultFont, Color.White, "Server Password: "******"", 64);
            ServerPassword.IsPassword = true;
            ServerPassword.TakesFocusOnMouseAction = true;
            UIButtonDynamic createButton = new UIButtonDynamic(100, 100, 200, 20, CreateServer, game.Data.DefaultButtonFrame, game.Data.DefaultFont, "Create Game");
            UIButtonDynamic backButton   = new UIButtonDynamic(100, 130, 200, 20, Back, game.Data.DefaultButtonFrame, game.Data.DefaultFont, "Back");

            UI.Add(serverNameLabel, ServerName, serverPasswordLabel, ServerPassword, createButton, backButton);
        }
Esempio n. 10
0
 static void Main()
 {
     using (var game = new ShooterGame())
         game.Run();
 }
Esempio n. 11
0
 public ClientBattleGameState(ShooterGame game)
     : base(game)
 {
     Client = (NetClient)game.NetPeer;
 }
Esempio n. 12
0
 public ServerBattleGameState(ShooterGame game)
     : base(game)
 {
     Server   = (NetServer)game.NetPeer;
     PlayerID = Map.AddObject(new Player());
 }