Anyway, OOP is your friend.
Jump to navigation
Jump to search
Revision as of 29 January 2022 at 15:14.
This is the thread's initial revision.
This is the thread's initial revision.
Good abstractions: Robot, Wave, BattleField
Bad abstractions: Radar, Gun, Wheel
Why? Because once you segment your code into gun & wheel, information sharing gets hard. A large part of wheel & gun can be shared and then you need EnemyHistoryManager etc. A Gun isn't a gun at all, all a gun does is a turret, a bullet plus some powder, and all a wheel does is turning. You don't need a driver or a brain, everything in your code is driver, everything in your code is brain. You just model everything in plain code, no need for extra layer of abstraction.