Building an interactive visual with stages
- Kimberly Agosto
- Nov 26, 2018
- 1 min read
November 26, 2018
I build a simple game in which the user clicks and drags the mouse to move the dog and the square around to collect the "crumbs". I used multiple variables to define the square as player, attach the image to the square, and create the crumbs.
I incorporated gravity (for the crumbs) so that they jump around, and a point of attraction as well as friction for the square. I added a library for these physics.
I'm still working on the code for this game and trying to make it more complex. I've been having challenges incorporated confetti that would adhere to gravity, change colors using random, and vibrate once the "you win!" screen pops up. I would also like to remove the square and make the image itself "player", but only make a designated area of the image = to player, such as the mouth of the dog.
https://editor.p5js.org/kimagosto/sketches/r1-3FhO0X

Comments