Being a noob, I'm currently experiencing around with Slick and I'm trying to make little games.

I load sprite sheets and then read their properties (to construct collision shapes) from text files.Those files contains only one line, which looks like this: <name>; <type>; <bunch of integer values>.

I was wondering if I could combine the (regular) text file with the (png) image file into one file?

The new file would look like this: the first x bytes are reserved for the text data, followed by the image data. The read method would separate it when reading the file.

I'd like to make some reusable classes (mini engine?), so please forgive me if its a silly idea.

The easiest way to do this is to put in to a jar that is on the classpath. The use the getResource method in Class. A jar is just a zip archive. How good is that? well that is what quake3 even uses for its pak files.

There is a trick to doing this however. I put the class RootClassResourceFolder in my resource folder. This class does nothing but provide a way to use relative paths in the getResource method.

1

URLurl =RootClassResourceFolder.class.getResource(s);

Anything else is more work than its worth IMO.

I have no special talents. I am only passionately curious.--Albert Einstein

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org