O'Reilly logo

Windows Phone 8 Game Development by Marcin Jamro

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

Adding asteroids to the game world

In this part of the chapter, you will add many asteroids to the game world. These will be rotating with random speed around all three axes.

Due to an availability of the Object3D class, adding a new model is quite simple. You just need to create a new class derived from the Object3D class, write a part of code for suitable initialization of the object, and define a collection of colors suitable for the vertices. A few other changes are required in the GameRenderer class, however, they are also straightforward and should not cause significant difficulties.

Asteroid class

To start, you create a new class called Asteroid. It represents a single asteroid placed in the game world. Data of all asteroids visible on the ...

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