This week's book giveaway is in the Other Open Source APIs forum. We're giving away four copies of Storm Applied and have Sean Allen, Peter Pathirana & Matthew Jankowski on-line! See this thread for details.
I have some graphics which are to be used for my game's sprites. I have shredded months of blood and sweat to produce them.
I'd like to distribute my game freely so that anyone can download it, play it and even look at the source code , but, on the other hand, I do not wish people stealing the graphics and claim they created/own them.
At the moment, I have the graphics saved into GIFs, JPEGs or PNGs formats and stored into a folder. The game, packaged in executable jar, access the image files within the jar.
I was wondering if I can some how save the graphics into other formats or use some other methods to store the graphics, so that people cannot just rip all the graphics out easily simply by unjar-ing the jar file. However, I still want the game to be able to load up the graphics with a reasonable speed.
I know I can't completely make the graphics safe from ripping, e.g. they can take screen dumps of the in-game graphics, but I just hope the graphics are not "so exposed" to the users so they can just rip it out without much effort or easily with an automatic process.
I thought about using Java code to generate some of the graphics at run time but I think that will hurt the game performance in large degree.
In pseudo code:
Convert the image to a byte array (using ImageIO and ByteArrayOutputStream and BufferedImage)
Convert the byte array to a String.
Print the string to your console.
Take this string and define it as a constant in your code When the image needs to be retrieved, String->byte array->Image