sweet glitchlove .
This commit is contained in:
parent
2772ec2563
commit
03112bb0fb
2 changed files with 34 additions and 3 deletions
2
conf.lua
2
conf.lua
|
|
@ -1,5 +1,5 @@
|
|||
function love.conf(t)
|
||||
t.window.width = 900
|
||||
t.window.width = 640
|
||||
t.window.height = 640
|
||||
t.window.title = "CHROMA SOLSTICE"
|
||||
end
|
||||
35
main.lua
35
main.lua
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue