Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Java 

Is 16 classes too much for a Space Invaders game?

(Feb 25, 2012 02:19 PM)SIM-524734 Wrote:  I'm making a Space Invader rip off. And, I have 16 classes. Is that too much? Should I cut on some?

Well compare it to most games this is quite small
Would you mind sharing the source once its ready? Im very interested in game programming.
Thanks and good job :)
I noticed you have several entities that are essentially the same but have specific differences. I would suggest creating something like "Entity" and other superclasses that you can subclass to all your Entity classes. That way, you don't need to copy/paste code for each of your entities. Something like a isColliding(...) and move(...) and all that in your super class and then extend it to all your specific entities/NPCs. If anything, make more!
I definitely would not make separate classes for entities/npcs etc. That is very bad practice. I assume you're looking at minecraft's design for that, which is a bad idea. What if you have thousands of NPCs? I'm not saying you have too many classes.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by iTeDDyFeb 18, 2015 06:42 AM 16 467 Feb 18, 2015 06:42 AM
Last Post: iTeDDy
[Python] by __init__Jul 16, 2013 10:37 AM 9 314 Jul 16, 2013 10:37 AM
Last Post: __init__
[.NET] by APTODec 10, 2012 01:58 PM 9 159 Dec 10, 2012 01:58 PM
Last Post: APTO