4 ms·
Here's a rogue-like game written in straight C, with hard-coded arrays, structs, and defines. https://github.com/tmewett/BrogueCE https://github.com/tmewett/Br
by tourgen 4y ago
Here's a rogue-like game written in straight C, with hard-coded arrays, structs, and defines.
https://github.com/tmewett/BrogueCE https://github.com/tmewett/BrogueCE
component systems are useful when you have no design doc, or a design doc written by new-hire monkeys. Or when management has no idea what the goals are.
- ajmmertens 4y agoOr if you want code that's easier to extend, read and don't want to do your own memory management. Here's a bit of code from that project that generates a monster: https://github.com/tmewett/BrogueCE/blob/master/src/brogue/Monsters.c#L63 https://github.com/tmewett/BrogueCE/blob/master/src/brogue/M... It just allocates an object per monster, followed by initializing a long list of members that presumably just gets longer as more game systems get added. The same code in ECS would look a lot simpler, and probably perform better/have better cache locality.