sweet glitchlove .

This commit is contained in:
0x81c 2015-03-12 03:27:27 -04:00
parent 2772ec2563
commit 03112bb0fb
2 changed files with 34 additions and 3 deletions

View file

@ -3,15 +3,17 @@ Timer = require "libs/hump/timer"
require "input"
require "color"
require "room"
require "player"
require "shaders"
require "debug_helpers"
function love.load()
_initDefaults()
_initGridVars()
loadSprites()
gameCanvas = love.graphics.newCanvas()
finalCanvas = love.graphics.newCanvas()
inputTimer = Timer.new()
currentRoom = Room:new{
@ -30,8 +32,37 @@ function love.update(dt)
end
function love.draw()
gameCanvas:clear()
finalCanvas:clear()
love.graphics.setCanvas(gameCanvas)
love.graphics.setBlendMode("screen")
currentRoom:draw()
love.graphics.setCanvas(finalCanvas)
local scaleCoefficient = .93
local samples = 7
love.graphics.push()
for i = 1, samples do
local c = 65 / (i * 1.75)
love.graphics.setColor(c, c, c)
love.graphics.scale(scaleCoefficient, scaleCoefficient)
love.graphics.translate((width / 2 - (width * scaleCoefficient) / 2) + 2, (width / 2 - (height * scaleCoefficient) / 2) + 2)
love.graphics.draw(gameCanvas, 0, 0)
end
love.graphics.pop()
love.graphics.setColor(255, 255, 255)
love.graphics.draw(gameCanvas, 0, 0)
love.graphics.setCanvas()
pixelate:send("seed", math.random())
pixelate:send("zoom", .2)
love.graphics.setShader(pixelate)
love.graphics.draw(finalCanvas, 0, 0)
end
function love.keypressed(key)