Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MILESTONE 3 : UPPER SECOND CLASS ( 6 0 % + ) a . Rather than loading 4 cube models manually, use an array of
MILESTONE : UPPER SECOND CLASS
a Rather than loading cube models manually, use an array of IModels to create and
store cubemodels.
i Using a loop and a random number generating function, create and place all
cubes at randompositions on the floor.
ii Consider using Cs rand function.
iii. Does the scene look the same every time the game is executed? That is because
rand is apseudorandom generator.
Note: checking for collisions between the sphere and cubes will lead to a reduced FPS
rate, therefore it is recommended that you utilise variable timing when moving your sphere
from this point on
b Update your cube pickup code to use spheretobox collision detection to check for
contact between thesphere and the cubes. Remember all the cubes are axisaligned.
Also remember that for every cubespicked up the sphere should be scaled to
times its size.
c When a player accumulates points, the game should enter a GameWon state. In
the GameWonstate:
i The sphere should not be able to move.
ii A congratulatory message should be displayed at the centre of the game
window.
d The game should now have states: Playing, Paused, GameWon and GameOver.
You may also want to display an appropriate message in the GameOver state, while
keeping the player fixed, instead of just stoping the game.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started