Summary

You accomplished a lot in this chapter. As it stands, TabletPaddle is a decent game that has a lot of room for development and improvement. The difficult and core functionality is present, the physics handles collisions fluidly, and the game responds quickly and correctly. I have compiled a list of some ideas to add to the game that may spark your interest. None of them involve Android touch programming, but they do involve logic and creativity:

  • Reset the game when the ball hits the ground: Right now, the ball just continues to bounce. What if an image with the words “Game Over” appears?
  • Keep score: You can detect when a ball is hit, so why not track the number of hits? Users can then see how well they’re doing.
  • Add levels: This task might be fairly demanding, but remember that the only difference between levels of this game would be the layout of the blocks.

In the brickposition.xml file, you could create sets of integers and integer arrays that store the location for the blocks within each level. After this chapter, you’re on your way to making some killer apps. You learned some new skills as you worked through the ins and outs of handling collisions between a ball, a paddle, and blocks. You also covered some game logic and developed an intriguing way to handle complex collisions. In the all-important world of reacting to users’ input, you provide sounds and make blocks disappear to reward users’ work.

In the future, you increase the complexity of the tablet’s actions. Specifically, in the next chapter, the processor will have a mind of its own. Instead of working only on the action of the player, the code can create events itself and make the player respond to unpredictable behavior.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.217.58