Generate random space invaders. The program works by generating a random block of pixels (4x6 by default), and then mirroring it on the Y axis.
Invaders can be produced as text (on stdout), or as a PNG image (to a file).
java -jar invaders-1.0-standalone.jar [options]
-help
: Display help text.-p,--png
: Generate output as a PNG. Cannot be specified withtext
.-t,--text
: Generate output as text. When this option is specified, a pixel (when specifying other options) will mean a single character. Cannot be specified withpng
.-x <arg>
: The number of un-mirrored, un-scaled pixels on the X axis of a tile (default: 4)-y <arg>
: The number of un-scaled pixels on the Y axis of a tile (default: 6)s,--scale: <arg>
: The scaling factor for a tile (default: 1). Tiles will be scaled by this number after all pixels have been generated.seed <arg>
: The random seed for tile generation. Specifying the same random seed will result in the same invaders being generated.
-b,--border <arg>
: The border width for a tile (default: 0). This number of pixels will be left clear around each tile.-tileX <arg>
: The number of tiles to create along the X axis (default: 1). Cannot be specified withpxWidth
.-tileY <arg>
: The number of tiles to create along the Y axis (default: 1). Cannot be specified withpxHeight
.-pxHeight <arg>
: The height (in pixels) of the final output. The number of tiles will be calculated to give this height. Cannot be specified withtileY
.-pxWidth <arg>
the width (in pixels) of the final output. The number of tiles will be calculated to give this width. Cannot be specified withtileX
.
-guassian <arg>
: The guassian blur radius to be used (image only, default: 3). Cannot be specified withtext
.-o,--output <arg>
: The output file name (image only, default: invader.png). Cannot be specified withtext
.
The project uses Gradle. So long as you have a Java 7 or higher installed, you can just
run ./gradlew standalone
and a standalone jar file will be generated as ./build/libs/invaders-1.0-standalone.jar
.