Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1
Chapter 20 ■ Coding gameplay: Set Up gameplay methodS and animated Camera View

private void setupQ4S3gameplay() {
if (pickS18 == 0) {diffuse24 = new Image("gamequad4s3fame0.png", 512, 512, true, true, true);
Shader24.setDiffuseMap(diffuse24); }
if (pickS18 == 1) {diffuse24 = new Image("gamequad4s3fame1.png", 512, 512, true, true, true);
Shader24.setDiffuseMap(diffuse24); }
if (pickS18 == 2) {diffuse24 = new Image("gamequad4s3fame2.png", 512, 512, true, true, true);
Shader24.setDiffuseMap(diffuse24); }
}
private void setupQ4S4gameplay() {
if (pickS19 == 0) {diffuse24 = new Image("gamequad4s4fame0.png", 512, 512, true, true, true);
Shader24.setDiffuseMap(diffuse24); }
if (pickS19 == 1) {diffuse24 = new Image("gamequad4s4fame1.png", 512, 512, true, true, true);
Shader24.setDiffuseMap(diffuse24); }
if (pickS19 == 2) {diffuse24 = new Image("gamequad4s4fame2.png", 512, 512, true, true, true);
Shader24.setDiffuseMap(diffuse24); }
}
private void setupQ4S5gameplay() {
if (pickS20 == 0) {diffuse24 = new Image("gamequad4s5fame0.png", 512, 512, true, true, true);
Shader24.setDiffuseMap(diffuse24); }
if (pickS20 == 1) {diffuse24 = new Image("gamequad4s5fame1.png", 512, 512, true, true, true);
Shader24.setDiffuseMap(diffuse24); }
if (pickS20 == 2) {diffuse24 = new Image("gamequad4s5fame2.png", 512, 512, true, true, true);
Shader24.setDiffuseMap(diffuse24); }
}


Figure 20-15. Create the setupQ4S1gameplay() through setupQ4S5gameplay() methods, using diffuse24 and
Shader24 objects

Free download pdf