This commit is contained in:
2021-09-07 14:16:04 -07:00
parent c78c4f32c1
commit 51da4b5f65
3 changed files with 5 additions and 2 deletions
+2 -2
View File
@@ -59,14 +59,14 @@ public class Space {
Canvas canvas = new Canvas( (int) this.height, (int) this.width, 255,255,255,255);
for(int i = 0; i < this.bodies.length; i ++){
canvas.drawSquare(5, (int) this.bodies[i].getXpos(), (int) this.bodies[i].getYpos(), 0, 0, 0, 255);
canvas.drawSquare(5, (int) this.bodies[i].getXpos(), (int) this.bodies[i].getYpos(), 255, 255, 255, 255);
}
File f = null;
try{
String frameNumberStr = String.valueOf(frameNumber);
frameNumberStr = frameNumberStr + ".png";
f = new File(frameNumberStr);
f = new File("frames/" + frameNumberStr);
ImageIO.write(canvas.image, "png", f);
}catch(IOException e){
System.out.println("Error: " + e);