Indeed. If you’ve got completely separate “Sprite”, “Effect”, “Emitter”, “Particle” and “Game entity” classes you’re well on your way to achieving everything you need to achieve.
Funny factoid: all my games are basically the same. Yes, even Revenge of the Titans compared to Ultratron. They’re so similar that the way we actually start a new game is literally to copy and paste the entire project in Eclipse and then rename the packages. I always end up with the same general structure: Entity class with a bunch of subclasses such as Player, Bullet, Building, etc. Game screen. Game state. Then a few bits and bobs like Weapons, etc.
It helps that the whole lot is sat largely atop a fairly stable set of libraries that handle sprites, particles, special effects, GUIs, etc. However these libraries didn’t grow in a vacuum. They were developed without great thought placed into reuse of neat API design as part of other games; gradually when I realise I want to pinch a bit of code for another game I have a think about whether it’s worth dragging it out of the original game and trying to make it work with another game. A lot of extreme refactoring goes on to achieve this, but then, I’ve now got 4 games to manage simultaneously with it all and making sure stuff doesn’t break is increasingly complex.
Cas 