Chapter 20 ■ Coding gameplay: Set Up gameplay methodS and animated Camera View
Figure 20-12. Create the setupQ3S1gameplay() through setupQ3S5gameplay() methods, using diffuse23 and
Shader23 objects
if (pickS13 == 2) {diffuse23 = new Image("gamequad3s3rock2.png", 512, 512, true, true, true);
Shader23.setDiffuseMap(diffuse23); }
}
private void setupQ3S4gameplay() {
if (pickS14 == 0) {diffuse23 = new Image("gamequad3s4rock0.png", 512, 512, true, true, true);
Shader23.setDiffuseMap(diffuse23); }
if (pickS14 == 1) {diffuse23 = new Image("gamequad3s4rock1.png", 512, 512, true, true, true);
Shader23.setDiffuseMap(diffuse23); }
if (pickS14 == 2) {diffuse23 = new Image("gamequad3s4rock2.png", 512, 512, true, true, true);
Shader23.setDiffuseMap(diffuse23); }
}
private void setupQ3S5gameplay() {
if (pickS15 == 0) {diffuse23 = new Image("gamequad3s5rock0.png", 512, 512, true, true, true);
Shader23.setDiffuseMap(diffuse23); }
if (pickS15 == 1) {diffuse23 = new Image("gamequad3s5rock1.png", 512, 512, true, true, true);
Shader23.setDiffuseMap(diffuse23); }
if (pickS15 == 2) {diffuse23 = new Image("gamequad3s5rock2.png", 512, 512, true, true, true);
Shader23.setDiffuseMap(diffuse23); }
}