Skip to content

Commit

Permalink
Updated resumeGame() logic for Rewarded Interstitial samples
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 557569873
  • Loading branch information
Justin Malandruccolo authored and maddevrelgithubbot committed Aug 17, 2023
1 parent 26122a9 commit b138412
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,17 +152,21 @@ public void onPause() {
@Override
public void onResume() {
super.onResume();
if (!gameOver && gamePaused) {
resumeGame();
}
resumeGame();
}

private void pauseGame() {
if (gameOver || gamePaused) {
return;
}
countDownTimer.cancel();
gamePaused = true;
}

private void resumeGame() {
if (gameOver || !gamePaused) {
return;
}
createTimer(timeRemaining);
gamePaused = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,17 +152,21 @@ public void onPause() {
@Override
public void onResume() {
super.onResume();
if (!gameOver && gamePaused) {
resumeGame();
}
resumeGame();
}

private void pauseGame() {
if (gameOver || gamePaused) {
return;
}
countDownTimer.cancel();
gamePaused = true;
}

private void resumeGame() {
if (gameOver || !gamePaused) {
return;
}
createTimer(timeRemaining);
gamePaused = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ class MainActivity : AppCompatActivity() {

public override fun onResume() {
super.onResume()
if (!gameOver && gamePaused) {
resumeGame()
}
resumeGame()
}

override fun onCreateOptionsMenu(menu: Menu?): Boolean {
Expand Down Expand Up @@ -133,11 +131,17 @@ class MainActivity : AppCompatActivity() {
}

private fun pauseGame() {
if (gameOver || gamePaused) {
return
}
countDownTimer?.cancel()
gamePaused = true
}

private fun resumeGame() {
if (gameOver || !gamePaused) {
return
}
createTimer(timeRemaining)
gamePaused = false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ class MainActivity : AppCompatActivity() {

public override fun onResume() {
super.onResume()
if (!gameOver && gamePaused) {
resumeGame()
}
resumeGame()
}

override fun onCreateOptionsMenu(menu: Menu?): Boolean {
Expand Down Expand Up @@ -133,11 +131,17 @@ class MainActivity : AppCompatActivity() {
}

private fun pauseGame() {
if (gameOver || gamePaused) {
return
}
countDownTimer?.cancel()
gamePaused = true
}

private fun resumeGame() {
if (gameOver || !gamePaused) {
return
}
createTimer(timeRemaining)
gamePaused = false
}
Expand Down

0 comments on commit b138412

Please sign in to comment.