diff --git a/README.md b/README.md index 4eb2223..64b6dce 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ :todoing -make sure all draw calls check if the object is within range --add normal map to each object -refactor rectablges to be polygons to reduce code -handle polygons in a moveable way -optimize shadow body calculations and drawing methods diff --git a/examples/test.lua b/examples/test.lua deleted file mode 100644 index 49e6a57..0000000 --- a/examples/test.lua +++ /dev/null @@ -1,53 +0,0 @@ --- Example: normal map generation testing -local LightWorld = require "lib" -local util = require "lib/util" -local normal_map = require "lib/normal_map" - -function love.load() - z = 1 - lightWorld = LightWorld({ - drawBackground = drawBackground, - drawForeground = drawForeground, - ambient = {55,55,55}, - refractionStrength = 32.0, - reflectionVisibility = 0.75, - }) - - -- create light - lightMouse = lightWorld:newLight(0, 0, 255, 127, 63, 300) - lightMouse:setGlowStrength(0.3) - - radius = 50 - circle_canvas = love.graphics.newCanvas(radius*2, radius*2) - util.drawto(circle_canvas, 0, 0, 1, function() - love.graphics.circle('fill', radius, radius, radius) - end) - circle_image = love.graphics.newImage(circle_canvas:getImageData()) - - local t = lightWorld:newImage(circle_image, 150, 150) - t:setNormalMap(normal_map.generateFlat(circle_image, "top")) - t:setShadowType('circle', 50) -end - -function love.mousepressed(x, y, c) - if c == "wu" then - z = z + 1 - elseif c == "wd" then - z = z - 1 - end -end - -function love.update(dt) - love.window.setTitle("Light vs. Shadow Engine (FPS:" .. love.timer.getFPS() .. ")") - lightMouse:setPosition(love.mouse.getX(), love.mouse.getY(), z) -end - -function love.draw() - lightWorld:draw(function(l, t, w, h, s) - love.graphics.setColor(255, 255, 255) - love.graphics.rectangle("fill", l, t, w, h) - love.graphics.setColor(0, 255, 0) - love.graphics.circle('fill', 150, 150, 50) - end) -end -