An error occurred while loading the file. Please try again.
-
Jan Kožusznik authored4d4c762b
Laboratory.java 471 B
package lab;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
public class Laboratory {
public void draw(Canvas canvas) {
GraphicsContext gc = canvas.getGraphicsContext2D();
World world = new World(canvas.getWidth(), canvas.getHeight());
while (!Routines.isEndOfThreadRequestedByJavaVM()) {
gc.clearRect(0, 0, canvas.getWidth(), canvas.getHeight());
world.draw(canvas);
Routines.sleep(25);
world.simulate(25);
}
}
}