Domanda

I just wonder what do I hardcode in my game? E.g do I have an external file for every Enemy properties so on or do I make a class?

So what info/stuff should I code and what should I have as a .file?

Cheers!

È stato utile?

Soluzione

Make a properties file, and instantiate a bean when you need that type of property. There aren't many good reasons to hardcode things. At the very least, make the hardcoded items into constants: public static final int XYZZY = 0;

That being said, I'll hardcode to get something working or for prototyping. Then I'll go back and generalize it.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top