O'Reilly logo

Developing AR Games for iOS and Android by Dominic Cushnan, Hassan EL Habbak

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Whack-A-Mole game

In this section, we will go over the design of the game we are making. It is a simple Whack-A-Mole game with a twist. Over our target, we want to render a ground filled with mole holes, where the moles will pop up and down randomly from them. The user will be able to shoot balls at the moles from the device to the target; if a ball hits a mole, we will make the mole disappear with a sound effect and spawn a particle effect.

There will be no score system or a way to actually clear the level. We will just have this game as a demonstration of how games are made for AR in a simple way. All assets used in this game are available in the Assets folder in the code bundle of this chapter.

Creating the ground for moles

The first thing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required