The making of a game with p5.play ツ

OVERVIEW

In this project, I created a simple catching game with my illustrations. I used p5 and p5.play libraries to create the game interactions and mechanisms.



DEVELOPMENT PROCESS

These are the main steps I took in approaching this project.


  • Set up development environment with npm
  • Looked at tutorial code of p5.play library functions
  • Laid out 3 stages/screens for the game: start, play, and game over
  • Imported sound, images, and font
  • Editing the catching mechanism to fit my illustration
  • (2 mid-process photos shown below)



  • ISSUE DEEP DIVE

    I ran into several issues in this project. One of the most notable issues was having different music playing at each stage of the game. This was a logic problem, as each song belonged to a different stage, and had to play at a different time depending on the user's actions.


    I approached this problem with several steps, including:

  • The audio was stacking on top of each other, so I created a boolean for each song to check if it was playing or not
  • The music would only play in the correct stage if their corresponding boolean = false
  • After looping through the game once, all music would stop playing


  • Final game here or shown below (best played on Chrome):



    IDEAS AND FUTURE WORK

    Here are some ideas for improving on this extension:


  • Have "lives" for the players, signified by musubi on the screen
  • Have a mute option for the game
  • Have different food themes/options for the player
  • Add multiple musubi or other foods, add some "bad" items to avoid catching


  • KUDOS

    I got lots of support and resources during this project, including:


  • Google's cookie extension template
  • The chrome.cookies API documentation
  • Stack overflow posts about working with javascript
  • Microsoft tutorial on building an extension
  • Medium article on building an image-replacing extension
  • Mozilla's developer resources: checkbox html
  • Big shoutout to my instructor Hannah for helping me work through my coding roadblocks