3 ms·
Rockets do make their own rocket noise, don't they? (if you prefer, we can call this "sound synthesis" instead of "audio rendering"). My point is that this code
by Ace17 10y ago
Rockets do make their own rocket noise, don't they?
(if you prefer, we can call this "sound synthesis" instead of "audio rendering").
My point is that this code probably shouldn't be in the same class than, for example, the "target following" code.
It would be an obvious violation the single responsibility principle (SRP).
Actually, I've seen lots of SRP violations caused by blindly "modelling the real world" (shape drawing functions inside the "Picture" class, inverted inheritance hierarchies, focusing on implementation reuse instead of focusing on interfaces, Square class derived from Rectangle class, ...). This alone is not a good enough design guide, and is sometimes counterproductive.
Have a look at how game developers struggle with deep class hierarchies. Many of them are moving, for the better, to Entity/Component based designs.
This is a step back from "real-world modelling" (since you don't need/have a "Rocket" class anymore).