private void addFrogToFrogHome(FrogHome frogHome) { SoundEffects.PlayHomeLandingSound(); frogHome.AddFrog(); this.gameCanvas.Children.Add(frogHome.Sprite); this.playerScores(); }
private void addFrogHomesToManager(int numberOfHomes) { for (var i = 0; i < numberOfHomes; i++) { var home = new FrogHome(); this.frogHomeManager.AddFrogHome(home); this.gameCanvas.Children.Add(home.Sprite); } }
private void handleFrogHomeOccupation(FrogHome home) { if (!home.IsFrogHomeOccupied()) { home.MarkFrogHomeOccupied(); this.playerManager.IncrementHousesOccupied(); } else { this.handlePlayerLosingLife(); } }
/// <summary> /// Checks for player on frog home collision. /// Precondition: player != null AND home != null /// </summary> /// <param name="player">The player.</param> /// <param name="home">The home.</param> /// <returns> /// True if player is intersecting a home's bounding box, false otherwise /// </returns> /// <exception cref="ArgumentNullException"> /// player /// or /// home /// </exception> public bool CheckForPlayerOnFrogHomeCollision(Frog player, FrogHome home) { if (player == null) { throw new ArgumentNullException(nameof(player)); } if (home == null) { throw new ArgumentNullException(nameof(home)); } return(player.BoundingBox.IntersectsWith(home.BoundingBox)); }
private void handleFrogMadeItHome(FrogHome frogHome) { if (frogHome.Sprite.Visibility == Visibility.Visible) { this.handleLifeLost(); } else { this.playerOnMovingLog = false; this.handlePlayerScored(); frogHome.Sprite.Visibility = Visibility.Visible; this.playerManager.IncrementFrogsInHomes(); this.checkForGameOver(); this.checkForLevelOver(); this.playerIsImmune = false; } }