April 2017
Beginner to intermediate
394 pages
9h 16m
English
The easy way to do a game object is to have a single struct that contains all of the data a game object will need. This seems correct because everything in the game has the same basic data. For example, we know players and enemies all have a position, scale, and rotation. So our struct will look like this:
struct GameObject { //using vectors from the Mach 5 Engine M5Vec2 pos; M5Vec2 scale; float rotation; };
This game object works well in theory, but it is too basic. It is true that everything in our game probably needs a position, scale, and rotation. Even an invisible trigger region needs these properties. However, as it stands, we can't draw our object: we have no health, and no way to do damage. So, let's ...
Read now
Unlock full access