Currently 1 script is used to dictate the behaviour of both (big & small) asteroid prefabs. It also generates the spawn location and physical forces applied to it.
Asteroid Behaviours:
We check the object's tag to differentiate between the two in the logic.
Most behaviour is the same, but there are differences:
Big asteroids split into two smaller ones.
Scale differences.
Options:
Keep the same, since the class is small and manageable.
Write an Asteriod base class with common behaviours, then extend off that per asteroid type.
This is proper design.
Asteroid Manager:
could help the Game Manger layout a level by spawning asteroids
move asteroid pools into it
could clean out the AsteroidBehaviour class
the pooling, spawning, forces.
Beahviour would mostly just be OnTrigger/Collision events
Currently 1 script is used to dictate the behaviour of both (big & small) asteroid prefabs. It also generates the spawn location and physical forces applied to it.
Asteroid Behaviours:
tag
to differentiate between the two in the logic.Options:
Asteroid Manager: