Question
Basketball Now try having more players as discussed in Exercise 16.2. You may find it frustrating to try and hit the basketball just with a
Basketball
Now try having more players as discussed in Exercise 16.2. You may find it frustrating to try and hit the basketball just with a spherical player. What if you have your player inherit from cCritterWall ? You could then either always adjust the wall to be at right angles to the current direction of motion, or you could create a richer kind of listener that lets you rotate the wall. A good combination might be to use the mouse to move the player and to use the left and right mouse buttons or Left and Right Arrow keys to rotate the player.
Make a tennis game Make a player that is a child of cCritterWall and which hits things like a paddle. Give it a listener that makes it possible to rotate the paddle with the Arrow keys or with left/right mouse clicks. Put a short vertical wall in the middle for a net
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