public Game1() { graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = screenWidth; graphics.PreferredBackBufferHeight = screenHeight; ScreenRectangle = new Rectangle( 0, 0, screenWidth, screenHeight); Content.RootDirectory = "Content"; Components.Add(new InputHandler(this)); stateManager = new GameStateManager(this); Components.Add(stateManager); TitleScreen = new TitleScreen(this, stateManager); StartMenuScreen = new StartMenuScreen(this, stateManager); GamePlayScreen = new GamePlayScreen(this, stateManager); AdminScreen = new AdminScreen(this, stateManager); CharacterGeneratorScreen = new CharacterGeneratorScreen(this, stateManager); EndGameScreen = new EndGameScreen(this, stateManager); BuyScreen = new BuyScreen(this, stateManager); SellScreen = new SellScreen(this, stateManager); SaveScreen = new SaveScreen(this, stateManager); highscoreScreen = new HighscoreScreen(this, stateManager); upgradeScreen = new UpgradeScreen(this, stateManager); stateManager.ChangeState(TitleScreen, null); }
void Start() { onHit = Resources.Load("Explosion02") as GameObject; navMeshAgent = GetComponent<NavMeshAgent>(); sounds = GameObject.FindObjectOfType<SoundsController>(); endGame = GameObject.FindObjectOfType<EndGameScreen>(); }
public void EndMatch(Player winner, Player second) { if (Server != null) { Server.GameOver(winner.ID, second.ID, (int)winner.ScoreValue.Value); return; } Debug.Log(Players.Count + " players remaining. Match complete"); if (EndGameScreenInstance == null) { if (EndGameScreenPrefab != null) { EndGameScreenInstance = Instantiate(EndGameScreenPrefab); } else { EndGameScreenInstance = FindObjectOfType <EndGameScreen>(); if (EndGameScreenInstance == null) { Debug.LogError("No End Game Screen instance found."); return; } } } EndGameScreenInstance.gameObject.SetActive(true); EndGameScreenInstance.Activate(true); OnMatchEnd.Invoke(); }
private float DecreaseStars(int lastWipeIndex, int firstWipeIndex) { bool flag = EndGameScreen.Get() is DefeatScreen; bool flag2 = false; if (flag && this.m_validPrevMedal) { if (!this.m_currMedalInfo.canLoseStars) { flag2 = true; } else if ((this.m_currMedalInfo.IsHighestRankThatCannotBeLost() && (this.m_currMedalInfo.earnedStars == 0)) && ((this.m_prevMedalInfo.rank == this.m_currMedalInfo.rank) && (this.m_prevMedalInfo.earnedStars == 0))) { flag2 = true; } } this.m_scrubRankDesc.SetActive(flag2); float delay = 0f; for (int i = this.m_stars.Count - 1; i >= 0; i--) { delay = (this.m_stars.Count - i) * 0.2f; RankChangeStar star = this.m_stars[i]; if ((star.gameObject.activeInHierarchy && (i < firstWipeIndex)) && (i >= lastWipeIndex)) { star.Wipe(delay); } } return(delay); }
void Start() { health = 1; sounds = GameObject.FindObjectOfType<SoundsController>(); this.endGameText.text = ""; this.endGameScreen = GameObject.FindObjectOfType<EndGameScreen>(); }
void EndtheGame(GameObject won) { won.SetActive(true); EndGameScreen.SetActive(true); Destroy(pauseMenuUI); Destroy(ball); }
public void Validate(EndGameScreen endGameScreen) { if (this.endGameScreen == null) { Console.WriteLine ("ControllerSupport: EndGameScreen.Validate: EndGameScreen is invalid, reinitializing.."); Initialize (endGameScreen); } }
// Called when a game is ended private void game_over() { // Delay 10 seconds Delay(10000); // Try to move on try { // Write why the game ended if (API.getEnemyPlayer().GetHero().GetRemainingHP() <= 0) { Log.say("Victory!"); } else if (API.getOurPlayer().GetHero().GetRemainingHP() <= 0) { Log.say("Defeat..."); } else { Log.say("Draw..?"); } // Click through end screen info (rewards, and such) if (EndGameScreen.Get() != null) { EndGameScreen.Get().m_hitbox.TriggerRelease(); //EndGameScreen.Get().ContinueEvents(); } } catch (Exception e) { Log.error("Exception: In endgame function"); Log.error(e.ToString()); } }
// Called when a game is ended private void game_over() { // Write why the game ended if (API.getEnemyPlayer().GetHero().GetRemainingHP() <= 0) { Log.say("Victory!"); } else if (API.getOurPlayer().GetHero().GetRemainingHP() <= 0) { Log.say("Defeat..."); } else { Log.say("Draw..?"); } // Click through end screen info (rewards, and such) if (EndGameScreen.Get() != null) { EndGameScreen.Get().m_hitbox.TriggerRelease(); //EndGameScreen.Get().ContinueEvents(); } // Delay 10 seconds after this method Delay(10000); }
void CleanUp() { try { VictoryScreen.Get().ContinueEvents(); } catch { } try { VictoryScreen.Get().m_hitbox.TriggerRelease(); } catch { } try { EndGameScreen.Get().ContinueEvents(); } catch { } try { EndGameScreen.Get().m_hitbox.TriggerRelease(); } catch { } try { WelcomeQuests.Get().m_clickCatcher.TriggerRelease(); } catch { } }
public CombatPhase(PhaseManager phaseManager, PlayerUI playerUI, bool skipCombat, float countdownTime, FinishCountdownEvent finishCountdownEvent) : base(phaseManager) { _playerUI = playerUI; _defeatScreen = phaseManager.EndGameScreen; _skipCombat = skipCombat; _countdownTime = countdownTime; _finishCountdownEvent = finishCountdownEvent; }
private void OnBlowUpSpellFinished(Spell spell, object userData) { EndGameScreen screen = (EndGameScreen)userData; if (this.AreBlowUpSpellsFinished()) { screen.Show(); } }
private void OnCollisionEnter2D(Collision2D other) { if (other.gameObject.tag == "Enemy") { StaticVars.StartGame = false; StaticVars.MinigameSpeed = 600; EndGameScreen.SetActive(true); GetComponent <AudioSource>().Play(); } }
/// <summary> /// End a finished game. /// </summary> public void DoEndFinishedGame() { if (EndGameScreen.Get() != null) { try { EndGameScreen.Get().m_hitbox.TriggerRelease(); } catch { } } }
private void OnRockGameOver() { HoldBack(5000); if (EndGameScreen.Get() != null) { HoldBack(5000); Notify("Game Over"); // EndGameScreen.Get().ContinueEvents(); try { EndGameScreen.Get().m_hitbox.TriggerRelease(); } catch { } } }
public void ShowScreen(EndGameScreen screen) { bool flag = false; if ((this.m_enemyBlowUpSpell != null) && !this.m_enemyBlowUpSpell.IsFinished()) { flag = true; this.m_enemyBlowUpSpell.AddFinishedCallback(new Spell.FinishedCallback(this.OnBlowUpSpellFinished), screen); } if ((this.m_friendlyBlowUpSpell != null) && !this.m_friendlyBlowUpSpell.IsFinished()) { flag = true; this.m_friendlyBlowUpSpell.AddFinishedCallback(new Spell.FinishedCallback(this.OnBlowUpSpellFinished), screen); } if (!flag) { screen.Show(); } }
public static void ObstacleHelicopterColision(Obstacle obstacle, Helicopter helicopter, ref bool collision, ref int lives, ref BigInteger score, int bombs) { if ((obstacle.StartX == helicopter.EndX && !(obstacle.EndY < helicopter.StartY || obstacle.StartY > helicopter.EndY)) || ((obstacle.EndY == helicopter.StartY || obstacle.StartY == helicopter.EndY) && !(obstacle.EndX < helicopter.StartX || obstacle.StartX > helicopter.EndX)) || (obstacle.EndX == helicopter.StartX && !(obstacle.EndY < helicopter.StartY || obstacle.StartY > helicopter.EndY))) { obstacle.StartX++; Window.DeleteObstacle(obstacle); lives--; score -= 100; collision = true; if (lives == 0) { EndGameScreen.FinishGame(score); } else { Window.UpdateScoreAndLives(lives, bombs, score, false, 0); } } }
protected virtual void Awake() { s_instance = this; CollectionManager.Get().RegisterAchievesCompletedListener(new CollectionManager.DelOnAchievesCompleted(this.OnCollectionAchievesCompleted)); AchieveManager.Get().TriggerLaunchDayEvent(); AchieveManager.Get().UpdateActiveAchieves(new AchieveManager.ActiveAchievesUpdatedCallback(this.OnAchievesUpdated)); this.m_hitbox.gameObject.SetActive(false); string key = "GLOBAL_CLICK_TO_CONTINUE"; if (UniversalInputManager.Get().IsTouchMode()) { key = "GLOBAL_CLICK_TO_CONTINUE_TOUCH"; } this.m_continueText.Text = GameStrings.Get(key); this.m_continueText.gameObject.SetActive(false); PegUI.Get().SetInputCamera(CameraUtils.FindFirstByLayer(GameLayer.IgnoreFullScreenEffects)); SceneUtils.SetLayer(this.m_hitbox.gameObject, GameLayer.IgnoreFullScreenEffects); SceneUtils.SetLayer(this.m_continueText.gameObject, GameLayer.IgnoreFullScreenEffects); if (!Network.ShouldBeConnectedToAurora()) { this.UpdateRewards(); } }
private void clientSpawn(string nextMap) // Actually does most of the work { EndGameManager.nextMap = nextMap; var rootPanel = GameHud.Current.RootPanel; for (int i = 0; i < rootPanel.ChildCount; i++) // Clear Hud { var child = rootPanel.GetChild(i); if (child is not ChatBox) // Preserve chatbox in endgame state { child.Delete(true); i--; } } screen = rootPanel.AddChild <EndGameScreen>(); scoreboard = rootPanel.AddChild <Scoreboard>(); // Create final scoreboard, stays invisible for now scoreboard.SetClass("endgame", true); scoreboard.OverrideClosed = true; scoreboard.Canvas.SortChildren(x => - (x as UI.ScoreboardEntry).Points.Text.ToInt()); // Sort scoreboard by points, high to low _ = endGameSequence(); }
public Game1() { graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = screenWidth; graphics.PreferredBackBufferHeight = screenHeight; ScreenRectangle = new Rectangle( 0, 0, screenWidth, screenHeight); Content.RootDirectory = "Content"; Components.Add(new InputHandler(this)); stateManager = new GameStateManager(this); Components.Add(stateManager); TitleScreen = new TitleScreen(this, stateManager); StartMenuScreen = new StartMenuScreen(this, stateManager); GamePlayScreen = new GamePlayScreen(this, stateManager); AdminScreen = new AdminScreen(this, stateManager); CharacterGeneratorScreen = new CharacterGeneratorScreen(this, stateManager); EndGameScreen = new EndGameScreen(this, stateManager); PauseScreen = new PauseScreen(this, stateManager); highscoreScreen = new HighscoreScreen(this, stateManager); upgradeScreen = new UpgradeScreen(this, stateManager); saveHistory = new SaveHistoryScreen(this, stateManager); initPrice = new InitialPriceScreen(this, stateManager); spaceShip = new SpaceShip(); board = new Board(); stateManager.ChangeState(TitleScreen); }
//Helicopter Collision public static void HelicopterObstacleColision(List <Obstacle> obstacles, Helicopter helicopter, ref int lives, ref BigInteger score, int bombs) { for (int i = 0; i < obstacles.Count; i++) { if ((obstacles[i].StartX == helicopter.EndX && !(obstacles[i].EndY <helicopter.StartY || obstacles[i].StartY> helicopter.EndY)) || ((obstacles[i].EndY == helicopter.StartY || obstacles[i].StartY == helicopter.EndY) && !(obstacles[i].EndX <helicopter.StartX || obstacles[i].StartX> helicopter.EndX)) || (obstacles[i].EndX == helicopter.StartX && !(obstacles[i].EndY <helicopter.StartY || obstacles[i].StartY> helicopter.EndY))) { Window.DeleteObstacle(obstacles[i]); obstacles.RemoveAt(i); i--; lives--; score -= 100; if (lives == 0) { EndGameScreen.FinishGame(score); } else { Window.UpdateScoreAndLives(lives, bombs, score, false, 0); } } } }
private void Awake() { Debug.Log("End game screen awake"); Instance = this; gameObject.SetActive(false); }
private void OnDestroy() { Debug.Log("End game screen destroy"); Instance = null; }
public override void Execute() { EndGameScreen.Get().m_hitbox.TriggerRelease(); EndGameScreen.Get().ContinueEvents(); ActionQueue.Remove(this); }
public GameManager(Enemy.Factory enemiesFactory, Player player, EndGameScreen endGameScreen) { _enemiesFactory = enemiesFactory; _player = player; _endGameScreen = endGameScreen; }
private void Initialize(EndGameScreen endGameScreen) { this.endGameScreen = endGameScreen; }
private void Awake() { instance = this; }
void ShowEndScreen(string text) { EndGameScreen.SetActive(true); EndGameScreen.transform.Find("Content/Upper/Result/Text").GetComponent <Text>().text = text; EndGameScreen.transform.Find("Content/Upper/Score/Text").GetComponent <Text>().text = "Puntos: " + Player.Instance.Score; }
public void OnClickReturnToMenu() { SceneManager.LoadScene(0); EndGameScreen.SetActive(false); }
private void EndGame() { EndGameScreen.ShowEndGameScreen(); }
public static void PlayApacheCombat() { for (int i = 0; i < 48; i++) { Thread.Sleep(10); Console.WriteLine(); } Console.Clear(); Console.BackgroundColor = ConsoleColor.Black; Console.Clear(); //Making playground Console.SetWindowSize(120, 47); char[,] playGround = new char[41, 150]; BigInteger playerScore = 0; int change = 100; Console.ForegroundColor = ConsoleColor.White; for (int i = 0; i < playGround.GetLength(1) - 30; i++) { Console.Write('*'); } Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine(" Player score: {0}", playerScore); Console.WriteLine(); Console.ForegroundColor = ConsoleColor.White; for (int i = 0; i < playGround.GetLength(1) - 30; i++) { Console.Write('*'); } for (int i = 0; i < playGround.GetLength(0) - 1; i++) { for (int j = 0; j < playGround.GetLength(1); j++) { playGround[i, j] = ' '; if (j < 120) { Console.Write(' '); } } } for (int i = 0; i < playGround.GetLength(1) - 30; i++) { playGround[playGround.GetLength(0) - 1, i] = '_'; Console.Write('_'); } //Making helicopter Helicopter apache = new Helicopter(playGround); List <Mountain> mountains = new List <Mountain>(); Mountain mountainObject = new Mountain(playGround); mountains.Add(mountainObject); int sparePositionsForMountain = rnd.Next(4, 16); int counterForSpareMountain = 0; List <FlyingObjects> flyingObjects = new List <FlyingObjects>(); FlyingObjects flyingObject = new FlyingObjects(playGround); flyingObjects.Add(flyingObject); int sparePositionsForFlyingObjects = rnd.Next(25, 40); int counterForSpareFlyingObject = 0; List <FireMissile> missile = new List <FireMissile>(); bool hit = false; List <FireBomb> bombs = new List <FireBomb>(); List <Base> bases = new List <Base>(); bool addBases = true; int passThisMountain = rnd.Next(3, 8); int passedMountains = 0; int missileAndBombCounter = 0; int repeatedCounterForMissilesAndBombs = 100; bool endGame = false; //Real game int whenToMoveMountainAndFlyingObjects = 3000; int moveMountainAndFlyingObjectsCounter = 1; Console.SetCursorPosition(apache.x, apache.y + 5); while (!endGame) { if (Console.KeyAvailable) { ConsoleKeyInfo key = Console.ReadKey(); if (key.Key.ToString() != ConsoleSpecialKey.ControlC.ToString()) { switch (key.Key) { case ConsoleKey.Z: { Console.SetCursorPosition(Console.CursorLeft - 1, Console.CursorTop); Console.ForegroundColor = ConsoleColor.Blue; Console.Write(playGround[apache.y, Console.CursorLeft]); Console.SetCursorPosition(apache.x, Console.CursorTop); if (bombs.Count == 0) { hit = false; FireBomb bomb = new FireBomb(playGround, apache.x, apache.y, ref hit, ref endGame); bombs.Add(bomb); if (hit) { bombs.RemoveAt(0); } else { bombs[0].MoveBomb(playGround, flyingObjects, bases, ref hit, ref playerScore); if (hit) { bombs.RemoveAt(0); } } } } break; case ConsoleKey.UpArrow: { Console.SetCursorPosition(apache.x, Console.CursorTop); Console.ForegroundColor = ConsoleColor.Blue; Console.Write(playGround[Console.CursorTop - 5, Console.CursorLeft]); Console.SetCursorPosition(apache.x, Console.CursorTop); apache.MoveHelicopterUp(playGround, ref endGame); } break; case ConsoleKey.DownArrow: { Console.SetCursorPosition(apache.x, Console.CursorTop); Console.ForegroundColor = ConsoleColor.Blue; Console.Write(playGround[Console.CursorTop - 5, Console.CursorLeft]); Console.SetCursorPosition(apache.x, Console.CursorTop); apache.MoveHelicopterDown(playGround, ref endGame); } break; case ConsoleKey.LeftArrow: { Console.SetCursorPosition(apache.x, Console.CursorTop); Console.ForegroundColor = ConsoleColor.Blue; Console.Write(playGround[Console.CursorTop - 5, Console.CursorLeft]); Console.SetCursorPosition(apache.x, Console.CursorTop); apache.MoveHelicopterLeft(playGround, ref endGame); } break; case ConsoleKey.RightArrow: { Console.SetCursorPosition(apache.x, Console.CursorTop); Console.ForegroundColor = ConsoleColor.Blue; Console.Write(playGround[Console.CursorTop - 5, Console.CursorLeft]); Console.SetCursorPosition(apache.x, Console.CursorTop); apache.MoveHelicopterRight(playGround, ref endGame); } break; case ConsoleKey.Spacebar: { Console.SetCursorPosition(apache.x, apache.y + 5); Console.ForegroundColor = ConsoleColor.Blue; Console.Write(playGround[apache.y, Console.CursorLeft]); Console.SetCursorPosition(apache.x, Console.CursorTop); if (missile.Count == 0) { hit = false; FireMissile missile1 = new FireMissile(playGround, apache.x, apache.y, ref hit, ref endGame); missile.Add(missile1); if (hit) { missile.RemoveAt(0); } else { missile[0].MoveMissile(playGround, flyingObjects, bombs, ref hit, ref playerScore); if (hit) { missile.RemoveAt(0); } } } } break; default: { Console.SetCursorPosition(apache.x, Console.CursorTop); Console.ForegroundColor = ConsoleColor.Blue; Console.Write(playGround[Console.CursorTop - 5, Console.CursorLeft]); Console.SetCursorPosition(apache.x, Console.CursorTop); } break; } } else { } Console.SetCursorPosition(apache.x, apache.y + 5); } if (missileAndBombCounter == repeatedCounterForMissilesAndBombs) { if (missile.Count != 0) { missile[0].MoveMissile(playGround, flyingObjects, bombs, ref hit, ref playerScore); if (hit) { missile.RemoveAt(0); } } if (bombs.Count != 0) { bombs[0].MoveBomb(playGround, flyingObjects, bases, ref hit, ref playerScore); if (hit) { bombs.RemoveAt(0); } } missileAndBombCounter = 0; } else { missileAndBombCounter++; } moveMountainAndFlyingObjectsCounter++; if (moveMountainAndFlyingObjectsCounter == whenToMoveMountainAndFlyingObjects) { bool canAdd = false; bool delete = false; moveMountainAndFlyingObjectsCounter = 1; for (int i = 0; i < mountains.Count - 1; i++) { delete = false; mountains[i].MoveMountain(playGround, missile, bombs, ref endGame, ref delete, ref canAdd); if (delete) { mountains.Remove(mountains[i]); } } if (mountains.Count > 0) { canAdd = false; delete = false; mountains[mountains.Count - 1].MoveMountain(playGround, missile, bombs, ref endGame, ref delete, ref canAdd); if (delete) { mountains.Remove(mountains[mountains.Count - 1]); } } if (canAdd) { if (sparePositionsForMountain > 5 && addBases) { if (passedMountains >= passThisMountain && sparePositionsForMountain - counterForSpareMountain >= 4) { addBases = false; Base base1 = new Base(playGround); bases.Add(base1); passedMountains = 0; passThisMountain = rnd.Next(4, 8); } else { passedMountains++; } } if (counterForSpareMountain == sparePositionsForMountain) { Mountain mountainObject1 = new Mountain(playGround); mountains.Add(mountainObject1); counterForSpareMountain = 0; sparePositionsForMountain = rnd.Next(4, 16); addBases = true; } else { counterForSpareMountain++; } } //moved mountains for (int i = 0; i < flyingObjects.Count - 1; i++) { delete = false; flyingObjects[i].MoveFlyingObjects(playGround, missile, bombs, ref endGame, ref delete, ref canAdd, ref playerScore); if (delete) { flyingObjects.Remove(flyingObjects[i]); } } if (flyingObjects.Count > 0) { canAdd = false; delete = false; flyingObjects[flyingObjects.Count - 1].MoveFlyingObjects(playGround, missile, bombs, ref endGame, ref delete, ref canAdd, ref playerScore); if (delete) { flyingObjects.Remove(flyingObjects[flyingObjects.Count - 1]); } } if (canAdd) { if (counterForSpareFlyingObject == sparePositionsForFlyingObjects) { FlyingObjects flyingObject1 = new FlyingObjects(playGround); flyingObjects.Add(flyingObject1); counterForSpareFlyingObject = 0; sparePositionsForFlyingObjects = rnd.Next(25, 40); } else { counterForSpareFlyingObject++; } } //moved flyingObjects if (bases.Count > 0) { for (int i = 0; i < bases.Count; i++) { hit = false; bases[i].MoveBase(playGround, missile, bombs, ref endGame, ref hit); if (hit) { bases.RemoveAt(i); } } } if (playerScore == change) { change += 100; whenToMoveMountainAndFlyingObjects -= 50; } Console.SetCursorPosition(apache.x, apache.y + 5); } } EndGameScreen._EndGameScreen(playerScore); }
protected void PunchEndGameTwoScoop() { EndGameScreen.Get().NotifyOfAnimComplete(); iTween.ScaleTo(base.gameObject, new Vector3(AFTER_PUNCH_SCALE_VAL, AFTER_PUNCH_SCALE_VAL, AFTER_PUNCH_SCALE_VAL), 0.15f); }
public EndGameScreenWrapper(EndGameScreen endGameScreen) { Console.WriteLine ("ControllerSupport: Creating EndGameScreenWrapper Wrapper."); Initialize (endGameScreen); }