My project is about the more revised version of the flappy bird with the rhythm and melody generated on the users own. My original design of my sketch is attached above. Users can use the entire game to make their own pieces of music by engaging with the flappy bird game. They can get coins by getting through the pipes in the first and then use the coins won in the game to engage in the shoot game in the next page. The first page is for users to explore the melody and try to make a harmony by themselves. They can press 1,2,3,4 to arpeggiate between the given notes in ways like upDown and randomWalk and when their score is high enough, they will be given the instructions to add notes to their current melody. When they would like to add their own rhythm in their music, they can press the button to access next page. The next page presents the rover, bow and arrow, where users can press the mouse to add their rhythm by shooting at the rover. The idea of the second page is based on the circular drum machine.
The link to my final project is here: https://editor.p5js.org/Amber1007/sketches/y7wl5A83S
It finally works like below.
The major code challenge for my final project is basically switching the pages, detect whether the collision of the bird and pipes exist and circular drum machine. For switching the pages, I found the example code here and then integrated it into my sketch by using the code below.
For detecting the collision, I found it hard to use the collision function in the p5js itself to solve my problem, since the pipes are actually always on the sketch. Therefore, I tried the method recommended by professor Luisa, just check the y position of bird when the pipes moving across the bird like the code I wrote below.
For the circular drum machine, I first tried the wrong way of calculating the position of the mouse and check which grid is pressed and needs to be played. Then under professor Luisa’s help, I finished the code below to generate the circular drum machine as shooting game by using radio and angle as the calculation unit.
However, I still have some questions to develop in the future. In the beginning of the game, the score I used to calculate the user gained sometimes will present a weird number which does not conform with my calculation and I have checked my calculation, I found nothing wrong. Another question is the collision problem, since I wanted to add real coins along the entire sketch as the pipes moving close to the bird, but I have not find a good way to detect the collision, so I will try to fix this in the future.