Created
March 5, 2019 11:50
-
-
Save EliteIntegrity/b351cc9bf61300f64835e688740546dc to your computer and use it in GitHub Desktop.
Add the menacePlayer function to the KotlinInvadersView class.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun menacePlayer() { | |
if (uhOrOh) { | |
// Play Uh | |
soundPlayer.playSound(SoundPlayer.uhID) | |
} else { | |
// Play Oh | |
soundPlayer.playSound(SoundPlayer.ohID) | |
} | |
// Reset the last menace time | |
lastMenaceTime = System.currentTimeMillis() | |
// Alter value of uhOrOh | |
uhOrOh = !uhOrOh | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment