Question: create a new Java class, Ant, that draws the path of an ant that is walking randomly around a JavaFX window. This should look a

create a new Java class, Ant, that draws the path of an ant that is walking randomly around a JavaFX window. This should look a little like a scribbling on a page. If the ant walks off the edge of the screen re-center the ant and continue the random walk. Use the basic template from the code from lecture X01.

In addition to that, you may find the following helpful: ...

primaryStage.setScene(scene);

Timeline timeline = new Timeline(new KeyFrame(Duration.millis(100), ae -> { /* your code goes here */ }));

timeline.setCycleCount(Animation.INDEFINITE);

timeline.play(); primaryStage.show(); ...

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!