Pro Java 9 Games Development Leveraging the JavaFX APIs

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

if (pickS4 == 2) {diffuse21 = new Image("gamequad1s4bird2.png", 512, 512, true, true, true);
Shader21.setDiffuseMap(diffuse21); }
}
private void setupQ1S5gameplay() {
if (pickS5 == 0) {diffuse21 = new Image("gamequad1s5bird0.png", 512, 512, true, true, true);
Shader21.setDiffuseMap(diffuse21); }
if (pickS5 == 1) {diffuse21 = new Image("gamequad1s5bird1.png", 512, 512, true, true, true);
Shader21.setDiffuseMap(diffuse21); }
if (pickS5 == 2) {diffuse21 = new Image("gamequad1s5bird2.png", 512, 512, true, true, true);
Shader21.setDiffuseMap(diffuse21); }
}


Before you can test all five of the attached quadrant 1 squares, you need to make sure your first five
OnMouseClicked event handler conditional if() statements are in place, inside of the createSceneProcessing()
method body. Select your first if (picked == Q1S1) conditional if() statement in Figure 20-1 and copy and
paste it four more times underneath itself. Change your Q1S1 references to Q1S2 through Q1S5, and change


Figure 20-6. Copy and paste the setupQ1S1gameplay() method four times; edit each to create the other four
methods

Free download pdf