June 2013
Intermediate to advanced
346 pages
8h 42m
English
Now that you’ve had a chance to have a bit of fun and drag the mallet around, you’ve probably noticed our first problem: the mallet can go way out of bounds, as seen in Figure 46, An out-of-bounds mallet. In this section, we’ll add some basic collision detection to keep our mallet where it belongs. We’ll also add some really basic physics to let us smack the puck around the table.

Let’s start off by adding the following bounds definitions to AirHockeyRenderer:
| AirHockeyTouch/src/com/airhockey/android/AirHockeyRenderer.java | |
| | private final |
Read now
Unlock full access