Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1
Chapter 18 ■ 3D Gameplay DesiGn: CreatinG your Game Content usinG Gimp anD Java

Having 4 random images per game board square to select from would require 160 images, and having 8
random images to select from for each game board square would require 320 images to be created by using
the work processes that you are learning about during this chapter.
It is important to remember that game board square corner imagery will need to be rotated 45 degrees,
as will all quadrant images. Some game board square side images (squares 4, 5, 9, 10, 14, 15, 19, and 20) will
need to be rotated 90 degrees to “face out” correctly on the game board. We’ll be looking at all of these digital
imaging scenarios during this chapter, which will be a fairly long one for a nonprogramming chapter, with
lots of GIMP screenshots.
That said, professional Java game development involves a whole lot more than coding, as JavaFX 9
supports a half-dozen new media genres, including 3D, Digital Illustration (SVG), Digital Imaging (PNG),
Digital Audio, and more!
Now that we’ve created the foundation for the GameSquare1.xcf game board square 1 image composite,
let’s create the others, substituting a correct perimeter color value for the top decoration portion of the
texture map and saving these using the same file name, while incrementing the number at the end by one
each time, until you have all 20. After that, all you have to do is add image layers to each of these to create the
board game content for the game board squares and the game board quadrants. It turns out that creating Pro
Java 9 Games involves a ton of hard work!
We can use the File ➤ Save As menu sequence to save another version of the file once we change
the color value of the game board square perimeter and replace the image layers with alternate content.
The easiest way for you to do this with surgical accuracy is use File ➤ Open As Layers and open a
gameboardsquare2.png texture map in a layer in the composite, use the Eyedropper (color picker) tool to
click the perimeter color to set the FG foreground color to that value, select your PaintCan (color filler) tool,
select the transparent game board square decoration layer, and click the PaintCan tool in the (red, in this
case) square color area. This will fill that red color with the next (orange) color value. Then, all you have to
do is to delete the layer with the default (blank) game board square color reference and use File ➤ Save As
to save the GameSquare2.xcf compositing file, which is now ready for you to fill with image data to be used
in and for your second board game square.


Figure 18-24. Use Run ➤Project and render the quadrant 1 and square 1 texture maps to check the
orientation and quality

Free download pdf