Wasn't gonna take part in this compo, since I prolly should focus on developing games4j.com, but since I got started thinking about making a very simple strategy game, it might save me time by actually doing it rather than thinking about how to do it, and count it as marketing of the site

I thought it was a quite difficult set of requirements, especially "black&white or grayscale" seemed difficult and dull, but then I read:
Sure, as long as it's monochromatic it's fine

wiki says: Monochromatic colors are all the colors (tints, tones and shades) of a single hue.
(
http://en.wikipedia.org/wiki/Monochromatic_color)
That makes it a lot more interesting, so I created a simple function to generate colors with a specific hue:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| public class ColorGenerator { private static final float HUE = 0.1f;
public static Color generateColor(float saturation, float brightness) { return new Color(Color.HSBtoRGB(HUE, inRange(saturation), inRange(brightness))); } public static Color generateColor(float saturation, float brightness, float alpha) { return new Color((Color.HSBtoRGB(HUE, inRange(saturation), inRange(brightness))&0xffffff)|(int)(inRange(alpha)*255.0f)<<24,true); } private static float inRange(float val) { val = Math.max(0, val); val = Math.min(1.0f, val); return val; } } |
I hope that this can be of use for other coders that want to spiff the game up a bit and still comply with the regulation.
I have already started a bit on the game, and am stretching most of the restrictions a bit, but I hope to have something to show by the deadline, or hopefully before. I am aiming at casual strategy, with such short time-span. I hope to have something to show by Friday, since I won't have much time to do changes on feedback during the weekend.