3 ms·
> The argument here is that it's far better to have player and monster be simple data structures, and a single function hit(player, monster, weapon). Naturally
by fenomas 8y ago
> The argument here is that it's far better to have player and monster be simple data structures, and a single function hit(player, monster, weapon).
Naturally it's better to be simple if the logic involved actually is simple, but surely the point of the example is that game logic typically isn't. Hits in games don't just change a hit-point value, they tend to play animations, trigger events, work differently depending on this or that piece of global state, etc.