Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MILESTONE 1 : THIRD CLASS ( 4 0 % + ) a . Set up the scene exactly as described in the previous section. b

MILESTONE 1: THIRD CLASS (40%+)
a. Set up the scene exactly as described in the previous section.
b. Implement keyboard control for the sphere using WASD keys:
i.'W' moves the sphere forward
ii.'S' moves the sphere backwards
iii. 'D' rotates the sphere clockwise
iv.'A' rotates the sphere anti-clockwise
v. The game should enter GameOver state if the player moves into the water, and
then stop.
c. Use kSphereSpeed and kRotationSpeed as constants for storing the speed
at which you move androtate the sphere. Choose a reasonable value that
works well in the lab and on your machine.
d. Implement movement for your top-down camera by adding keyboard keys:
i.'Up' moves the camera forward along the world z-axis
ii. 'Down' moves the camera backwards along the world z-axis
iii. 'Right' moves the camera right along the world x-axis
iv. 'Left' moves the camera left along the world x-axis
e. The P key causes the game to enter a Paused state. In the Paused state:
i. Nothing should move
ii. Hitting the P key causes the game to transition to the Playing state
f. In all game states, the player should be able to press the Escape key to quit the game.
g. The sphere should pick up cubes that are very close to it:
i. Calculate the distance between the sphere and all cubes.
ii. If the distance is not greater than the sum of the sphere's radius and
half the width of the cube, the cube should be picked up by the
sphere.
iii. For example, if the sphere's radius is 10 units, then any cube
within (10+52)12.5 units ofsphere should be picked up.
iv. Picked up cubes should not be visible (think of a way to make the cube
disappear).
h. The code you submit MUST compile without errors.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

9th Edition

0135188148, 978-0135188149, 9781642087611

More Books

Students also viewed these Databases questions