Question: Error: local variable defined in an enclosing scope must be final or effectively final Animation.java X C:Usersasus gitlab-2-oldJoker233srcmain resources orc_animation orc_forward_southeast.png 36 370 @Override A

Error: "local variable defined in an enclosing scope must be final or effectively final"Error: "local variable defined in an enclosing scope must be final or

Animation.java X C:\Users\asus gitlab-2-oldJoker233\src\main resources orc_animation orc_forward_southeast.png 36 370 @Override A 38 public void start(Stage theStage) { 39 theStage.setTitle("Orc"); 40 41 boolean flagi = true; 42 boolean flag2 = true; 43 44 Group root = new Group(); 45 Scene theScene = new Scene(root); 46 theStage.setScene (theScene); 47 48 Canvas canvas = new Canvas(canvasWidth, canvasHeight); 49 root.getChildren() .add(canvas); 50 GraphicsContext gc = canvas.getGraphicsContext2D(); 51 ArrayList orc_img = createImage(); 52 53 final long startNanoTime = System.nanoTime(); 54 55e new AnimationTimer() { 4 560 public void handle(long currentNanoTime) 57 { 58 double t = (currentNanoTime - startNanoTime) / 1e9; 59 60 if(xloc == canvasWidth) { 61 flag = false; 62 } 63 else if(xloc == 0) { X 64 flash = true; 65 } 66 if(yloc == canvasHeight) { 67 yloc += yIncr; 68 } else if(yloc == 0) { 69 yloc += yIncr; 70 } 71 72 if(flagi == true) { 73 xlc += xIncr; 74 } else { 75 xlc - xIncr; 76 } 77 78 if(flag2 == true) { yloc += yIncr; 80 } else { 81 yloc -- yIncr; 82 } 83 //xlos += xIncr; 84 //ylos += yIncr; 85 86 // Clear the canvas 87 gc.clearRect(0, 0, canvasWidth, canvasHeight); 88 79

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!