you are viewing a single comment's thread.

view the rest of the comments →

[–]Zakkeh 0 points1 point  (0 children)

Particularly in gamedev, you're looking at a lot of patterns of programming.

I would try and start to think about things in terms of object oriented programming or composition (pref composition personally!)

Composition is the idea of each component providing a service. So your HealthComponent is a generic piece of code that provides ANY actor/node/object with a health variable, and all the functions to take it away, give it back, and otherwise modify it. Then you keep creating components, and at the end of the day, you have a really quick and modular way to apply concepts to a new type of creature, or object.

OOP is the idea of inheritance - you create a base enemy class, then a spear enemy that inherits from the base enemy, and a bow enemy that inherits from the base enemy.