So I am creating a side scrolling Gradius-esque game using OOP techniques. I’ve got a pretty good set up so far: I have a CollisionManager class that tracks all enemies, bullets, and the “hero”… it dispatches an event when a collision occurs so that each object can independently handle animations and status changes without having to be tightly coupled with other classes.
The problem I am running into is the issue of bullet behavior. I have different types of bullets (i.e., blaster, missiles, etc). And I want to give the missiles a homing effect without giving it a reference to it’s target object which would mean that the bullet would always have to be aware of where the target is.
Instead, I would guess that the path to loose coupling would take me to an MVC type design with a Controller determining the behavior of the bullet.
Am I over-thinking this here? I wanted to throw out my conceptual dilemma to see if anyone has an easy design solution…
Let me know what you think.
AR