Gravitation game

To put into practice what you have learned about steering behaviors, we will build a basic game. The player's objective is to collect some pickup items that rotate around different planets placed in the world, while escaping from enemies. The enemies are non-playable characters that seek the playable character and avoid the planets.

We will represent the characters as particle systems, and the final version of the game will look like this:

Gravitation game

Basic game objects

As usual, we will define a base class that wraps the access to the CircleShape attribute with the updated center:

from cocos.cocosnode import CocosNode from cocos.director import ...

Get Python Game Programming By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.