Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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"image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions

Question

How can you defend against SQL injection attacks?

Answered: 1 week ago