General Instructions:
Click on the link to open the
Starter file,
it contains images and some code to help you get started.
Now, click on the fork icon .
Then at the bottom it will give the option to fork the project to save and modify .
Add the code inside the highlighted box in the examples.
Under box, write the pair of push() and pop(), to consolidate the box code.
Then add the translate() with x-axis and y-axis positions to make it appear in the center.
Finally, make a 3D box and rotate in all axes.
Now, under the sphere add the pair of push()and pop() to consolidate the sphere code.
Add translate() with x and y axes to make it appear higher up.
Finally add the 3D sphere.
Make two variables x and y , which have ths initial position of the 3D box.
Replace the hard coded values inside the translate of the 3D box with the variable x and y.
Since variables can change we can use them to move the 3D box.
In the 3D sphere code, replace the hard coded values in the translate and
use the mouse x and y position to make the 3D sphere move.
Under the collision detection, make a local variable "d" to store
the calculation of the distance between 3D box and the sphere using their x and y positions.
Make a conditional statement, that checks how close the two objects needs to be
that the collision can happen. And when collison happens randomly change the x and y position of the 3D box.
random(minmum value , maximum value).
Make the variable of score and initialise it with 0.
Increment the score by any value of your choice.
Finally add the scoring function to make the score appear on the 3D canvas.
It will also have the win screen condition if the score reaches 50.
Happy Coding!!