O'Reilly logo

Mastering Android Game Development by Raul Portales

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

Chapter 3. Into the Draw Thread

In this chapter, we are going to improve the rendering of sprites for our game. For this, we are going to use a custom GameView that will perform low-level drawing. We will make two different implementations: one that extends from View and another one that extends from SurfaceView. We will let DrawThread be a real thread, to work better with this GameView.

We will refactor the project, creating a Sprite class that will be used for all the items that are drawn in the game. We will draw bitmaps on a Canvas and learn about the transformation matrix used to do this.

To continue improving the game, we will add enemies. They will be a wave of asteroids moving towards our spaceship. For this, we will learn the concept of ...

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