Rum is a PWA game developed in Javascript with p5.js and p5.play using the factory design pattern, in this game you are an ovule and need to avoid sperm, the longer you survive the better.
In p5.js we have two main prebuilt functions, setup()
and draw()
.
The setup()
function is executed at the beginning of the program, in this project I used it to:
- Create the canvas where objects will be rendered
- Instantiate game objects
- Restart the game
The draw()
function is executed at each frame update, we can consider it as the game loop, in this project I used it to:
- Render game entities on screen
- Check the game's business rules