Renoki: Making An Android Game (part 10)
Added level functionality. Level is a preference (need to save the level when the app is closed) that is stored in the global application context, along with all the other saved player states (hammerType, gold, score, health, etc). I insert monsters and adjust speed based on the level. At the moment, there is a timer that runs for 10 seconds until the level ends and progresses to the next.
Something I wanted to implement that was missing from the iphone version was waiting for all monsters to retreat before ending the round. People were complaining that they would try to hit something only to have the LEVEL COMPLETE message pop up and block them. I basically just stop inserting monsters when the timer is past the limit (10 seconds right now) and don’t end the round until the entire gameboard is empty. I think this is a lot better.
I also added the money drops for monsters. Instead of creating a money object and replacing the monster with it, I merely change the monster bitmap to be the diamond. Then I reset the duration of the monster to make sure it doesn’t immediately run away. I also had to add an extra state isMoney to the monster to check if it’s been turned into a diamond. If isMoney is true, I can ignore all the features of the monsters and just immediately kill it.
The only main feature remaining is the store, which Allison is working on.