/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { using (ShooterGame game = new ShooterGame()) { game.Run(); } }
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"); }
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); }
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); }
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); }
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); }
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); }
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); }
static void Main() { using (var game = new ShooterGame()) game.Run(); }
public ClientBattleGameState(ShooterGame game) : base(game) { Client = (NetClient)game.NetPeer; }
public ServerBattleGameState(ShooterGame game) : base(game) { Server = (NetServer)game.NetPeer; PlayerID = Map.AddObject(new Player()); }