Question: Write a P5 Sketch that implements a simple computer game where you squish bugs (or other creatures) with the mouse. Begin with several bugs walking
Write a P5 Sketch that implements a simple computer game where you squish bugs (or other creatures) with the mouse.
Begin with several bugs walking around the screen. The user must click the mouse on a bug to squish it. The user must squish as many bugs as possible in 30 seconds. Keep an on-screen count of the number of bugs squished and an on-screen timer counting down from 30 seconds. The game should get harder as it proceeds, so make the bugs move faster with each squish. After 30 seconds, the game ends.
In the case of the bug, there should be an additional image: squished and dead. Animate the bug so that it faces the direction that it's moving. You can accomplish this by drawing an animation for each direction, or by simply using the rotate or scale function. It's recommended that you define a class to represent a bug, and use an array of objects to create several bugs.
Note, the player must *click* on a bug to kill it. Do not simply test if the mouse button is pressed while the pointer is on the bug, as this lets the player click once and simply drag around to score squishes. Too easy!
PLEASE WRITE THE JAVA SCRIPT CODE THAT WOULD SATISFY THIS PROJECT. I HAVE THE SPRITE SHEETS FOR THE BUGS ALREADY, I JUST NEED THE CODE TO CREATE THIS GAME!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
