diff --git a/src/raytracer_nim.nim b/src/raytracer_nim.nim index 73b3d6f..c4a7d86 100644 --- a/src/raytracer_nim.nim +++ b/src/raytracer_nim.nim @@ -19,6 +19,14 @@ when isMainModule: let colour = colour(1, 0, 0) while projectile.position.x >= 0 and projectile.position.x < 800 and projectile.position.y >= 0 and projectile.position.y < 600: world.writePixel(projectile.position.x, 600 - projectile.position.y, colour) + if(projectile.position.x + 1 < 800): + world.writePixel(projectile.position.x + 1, 600 - projectile.position.y, colour) + if(projectile.position.x - 1 >= 0): + world.writePixel(projectile.position.x - 1, 600 - projectile.position.y, colour) + if(600 - projectile.position.y - 1 >= 0): + world.writePixel(projectile.position.x, 600 - projectile.position.y - 1, colour) + if(600 - projectile.position.y + 1 < 600): + world.writePixel(projectile.position.x, 600 - projectile.position.y + 1, colour) projectile = projectile.tick(environment) writeFile("output.ppm", world.toPPM())