Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Summary

In this chapter, I introduced cocos2D. We set up the sample templates and took the Hello World project from just a label to a simple augmented-reality game. We scaled the camera view to match the aspect ratio of our device in landscape mode. Then, we set up event handlers for user touch events.

Our simple game handles the touch events of the user, creates and starts a particle system for visual events, and even has explosion sound effects. We even built a separate HUD layer, independent of the gaming layer, to count metrics and display them to the user.

In the next chapter, we'll take augmented-reality gaming to the next level and work in the gyroscope to create a 360 degree first-person augmented-reality shooter game.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint