O'Reilly logo

Monkey Game Development by Michael Hartlef

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 bad guys—our beloved enemies

To demonstrate how you can add more objects with their own behaviors and have extra control over them, we will create a new class for the enemy objects. Each enemy will move along a pre-calculated path during its lifetime, and so it needs its own update procedure. All enemies will be stored inside the enemy list of the game class and their paths will be used inside a stack that is the property of each enemy.

So, let's play Dr. Frankenstein.

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