koboredux
koboredux copied to clipboard
New enemy AI engine
Implement the behaviors needed for new enemies, similar to those in XKobo, in a modular, parameterized form, that lends itself for configuration via the theme parser or similar. (See #158.)
General guidelines
- One class only, so we can keep a pool of objects in a simple and efficient manner
- Cover player, enemies, bullets, explosions etc, to avoid special cases
- Hardwired states:
- (Unused)
- Alive
- Exploding
- Arbitrary internal states:
- Multiple sets of parameters
- Inheritance; define states as diffs from other states
- Variables:
- Position
- Velocity
- Health
- Events:
- Spawned, enemy seen, flock seen, enemy died, damage, variable changes, etc
- Events can change state
- Events can modify variables
- Parameters/features (some of these are already in cs.[ch]):
- Collision groups
- Collision mask
- Physics behavior
- "Team" groups
- Chase/evade behaviors
- Flock behaviors
- Collision groups