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

Helper functions for the update process

Just as in the creation process, where we have created several smaller helper methods to split up the process and make it more readable, we will have the same for the update process. Another reason besides readability is reusability. You don't want to code the same thing several times. That is why you use functions and methods.

Creating the atom elements

Each atom object is also a composed object—the image object that you can see and, depending on how many connectors the atom has, several invisible circles, which we will use to detect a connection (collision) with a connector next to it.

Collision circle objects

Every object can be invisible but still act on updates and collision detection.

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