For now, I’ve managed to figure out the majority of the code for everything, such as the movement of the bird controlled by the photoresistor values as well as controlled by the microphone, the movement of the viruses, the collision detection code, the switching of game states when the user presses start or when the user wins or loses, etc.
Challenges From Before
Before, I struggled with trying to make my microphone as my input where its values determined from the amplitude values will correspond to the up and down movement of the bird. I wasn’t able to figure out why I couldn’t make the bird move no matter how loud I screamed into it (quite embarrassing). However, after talking to Jack, I’ve managed to resolve the issue and now I am able to control the bird’s up and down movement via the microphone.
Some of the problems that I’m encountering right now would include trying to configure the collision detection code to make it detect collision more accurately around the images as I’ve noticed that sometimes when the bird only grazes the virus, it does not detect a collision. It does detect only when the center of the bird collides with the center of the viruses.
Another problem right now is how I am able to incorporate the two types of input (photoresistor and microphone) to control the bird within the same game. This is a problem because I’m afraid that if I added the microphone input code into the serial event code for my photoresistor values, it might mess up the entire code. So, right now, I’m kind of struggling to find a solution where I can allow the user to choose to use which type of mode to play in, whether by the photoresistor or by the microphone.
A few extra ideas that I’ve thought of adding to my game could be applied to both the bird and the viruses.
One idea that I’ve came up with is that I could probably alter the speed of each appearing virus and set their speeds to be random so that each virus will be moving in different speeds to raise the difficulty.
Another idea that I’ve had is where every time the viruses pass the left side of the screen, I could add a score board which will add a score to it every time the virus touches the left side of the screen. After the game ends, it can display the score of the user to compare with other players. However, if I used this idea, I wouldn’t need a timer because then the objective is to now avoid as many as the user can instead of trying to survive and not touch the viruses within the limited time. But, it’s just an idea for me to think about and to work on if I have time.