public void Update() { var player = GameWorld.GetPlayers()[0]; if (player.GetCollRectangle().Intersects(_collRectangle)) { _levelFinishedSound.PlayOnce(); } if (_changeLevelTimer.TimeElapsedInMilliSeconds > 3000) { TMBAW_Game.GoToMainMenu(); } }
/// <summary> /// The main entry point for the application. /// </summary> /// static void Main(string[] args) { Console.WriteLine("Arg count: " + args.Length); // Joining lobby from outside the game. if (args.Length > 1) { if (args[0] == "+connect_lobby") { GameLaunchLobbyId = ulong.Parse(args[1]); LaunchedFromInvite = true; } } try { SteamAPI.Init(); } catch (Exception e) { MessageBox.Show(e.Message); } #if !DEBUG if (SteamAPI.RestartAppIfNecessary(new AppId_t(595250))) { return; } #endif #if !DEBUG try { using (TMBAW_Game game = new TMBAW_Game()) { game.Run(); } } catch (Exception e) { MessageBox.Show(e.Message + "::" + e.StackTrace + "::" + e.InnerException.Message); } #else using (TMBAW_Game game = new TMBAW_Game()) { game.Run(); } #endif }
public static void Initialize(TMBAW_Game game1) { _font8 = ContentHelper.LoadFont("Fonts/x8"); _font32 = ContentHelper.LoadFont("Fonts/x32"); _chooseLevel = new TextButton(Vector2.Zero, "Choose a Level", false); _chooseLevel.MouseClicked += chooseLevel_MouseClicked; _buttons.Add(_chooseLevel); _quit = new TextButton(Vector2.Zero, "Quit", false); _quit.MouseClicked += quit_MouseClicked; _buttons.Add(_quit); _options = new TextButton(Vector2.Zero, "Options", false); _options.MouseClicked += options_MouseClicked; _buttons.Add(_options); _multiplayer = new TextButton(Vector2.Zero, "Multiplayer", false); _multiplayer.MouseClicked += multiplayer_MouseClicked; _buttons.Add(_multiplayer); _storyModeButton = new TextButton(Vector2.Zero, "Story Mode", false); _storyModeButton.MouseClicked += storyMode_MouseClicked; _buttons.Add(_storyModeButton); _backButton = new TextButton(Vector2.Zero, "Back", false); _backButton.MouseClicked += backButton_MouseClicked; _buttons.Add(_backButton); _startMultiplayerGame = new TextButton(Vector2.Zero, "Start Game", false); _startMultiplayerGame.MouseClicked += StartMultiplayerGame_MouseClicked; _buttons.Add(_startMultiplayerGame); foreach (var button in _buttons) { button.ChangeDimensions(new Vector2(TextButton.Width * 2, TextButton.Height * 2)); button.Color = new Color(196, 69, 69); } _levelSelection = new LevelSelection(); SaveSelector.Initialize(); GraphicsRenderer.OnResolutionChanged += SetElementPositions; SetElementPositions(TMBAW_Game.UserResWidth, TMBAW_Game.UserResHeight); }
static void quit_MouseClicked(Button button) { // game1.GameData.SaveGame(); TMBAW_Game.Quit(); }