consistent indentation
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
function GameworldDrawPrepare()
|
||||
if game_resize then
|
||||
Camera.height = game.height
|
||||
Camera.width = game.width
|
||||
Canvas.Darkness:Recreate()
|
||||
end
|
||||
pcr, pcg, pcb, pca = love.graphics.getColor()
|
||||
if game_resize then
|
||||
Camera.height = game.height
|
||||
Camera.width = game.width
|
||||
Canvas.Darkness:Recreate()
|
||||
end
|
||||
pcr, pcg, pcb, pca = love.graphics.getColor()
|
||||
love.graphics.setScale(game.scale,game.scale)
|
||||
love.graphics.setColor(1,1,1,1)
|
||||
end
|
||||
|
||||
function GameworldDrawEnd()
|
||||
love.graphics.setColor(pcr, pcg, pcb, pca)
|
||||
pcr, pcg, pcb, pca = nil, nil, nil, nil
|
||||
love.graphics.setColor(pcr, pcg, pcb, pca)
|
||||
pcr, pcg, pcb, pca = nil, nil, nil, nil
|
||||
end
|
||||
|
||||
function GameworldDrawBackground()
|
||||
-- obscure a bit
|
||||
-- obscure a bit
|
||||
love.graphics.setColor(0.7,0.7,0.7)
|
||||
for i = 1, #LevelTiles do
|
||||
for j = 1, #LevelTiles[i] do
|
||||
@@ -35,32 +35,32 @@ function GameworldDrawBackground()
|
||||
end
|
||||
|
||||
function GameworldDrawParticles()
|
||||
love.graphics.setColor(0.7,0.7,0.7)
|
||||
for _, particle in pairs(LoadedObjects.Particles) do
|
||||
particle:HandleAnimation()
|
||||
end
|
||||
love.graphics.setColor(0.7,0.7,0.7)
|
||||
for _, particle in pairs(LoadedObjects.Particles) do
|
||||
particle:HandleAnimation()
|
||||
end
|
||||
end
|
||||
|
||||
function GameworldDrawEntitiesBackground()
|
||||
for _, enty in pairs(LoadedObjects.Entities) do
|
||||
enty:DrawBackground()
|
||||
end
|
||||
for _, enty in pairs(LoadedObjects.Entities) do
|
||||
enty:DrawBackground()
|
||||
end
|
||||
end
|
||||
|
||||
function GameworldDrawEntities()
|
||||
love.graphics.setColor(0.7,0.7,0.7)
|
||||
love.graphics.setColor(0.7,0.7,0.7)
|
||||
for _, enty in pairs(LoadedObjects.Entities) do
|
||||
enty:HandleAnimation()
|
||||
end
|
||||
end
|
||||
|
||||
function GameworldDrawForeground()
|
||||
love.graphics.setColor(1,1,1)
|
||||
love.graphics.setColor(1,1,1)
|
||||
for i = 1, #LevelTiles do
|
||||
for j = 1, #LevelTiles[i] do
|
||||
if LevelTiles[i][j].id ~= 0 then
|
||||
|
||||
local depth = TileData[LevelTiles[i][j].id].depth
|
||||
local depth = TileData[LevelTiles[i][j].id].depth
|
||||
DrawTile(
|
||||
LevelTiles[i][j],
|
||||
tileProperties.scale * j * tileProperties.width + tileProperties.scale * (levelProperties.offset.x - tileProperties.width) - Camera.pos.x,
|
||||
@@ -74,53 +74,53 @@ function GameworldDrawForeground()
|
||||
end
|
||||
|
||||
function GameworldDrawDarkness()
|
||||
Canvas.Darkness:Reset()
|
||||
Canvas.Darkness:DrawingStart()
|
||||
love.graphics.setBlendMode("replace")
|
||||
love.graphics.setColor(0,0,0,0)
|
||||
for _, light in pairs(LoadedObjects.Lights) do
|
||||
if light.range ~= 0 then
|
||||
local position = {
|
||||
x = (light.pos.x - Camera.pos.x) / game.scale,
|
||||
y = (light.pos.y - Camera.pos.y) / game.scale
|
||||
}
|
||||
local range = (light.range + light.flicker) / game.scale
|
||||
love.graphics.circle(
|
||||
"fill",
|
||||
position.x,
|
||||
position.y,
|
||||
range
|
||||
)
|
||||
end
|
||||
end
|
||||
Canvas.Darkness:DrawingEnd()
|
||||
Canvas.Darkness:Draw()
|
||||
Canvas.Darkness:Reset()
|
||||
Canvas.Darkness:DrawingStart()
|
||||
love.graphics.setBlendMode("replace")
|
||||
love.graphics.setColor(0,0,0,0)
|
||||
for _, light in pairs(LoadedObjects.Lights) do
|
||||
if light.range ~= 0 then
|
||||
local position = {
|
||||
x = (light.pos.x - Camera.pos.x) / game.scale,
|
||||
y = (light.pos.y - Camera.pos.y) / game.scale
|
||||
}
|
||||
local range = (light.range + light.flicker) / game.scale
|
||||
love.graphics.circle(
|
||||
"fill",
|
||||
position.x,
|
||||
position.y,
|
||||
range
|
||||
)
|
||||
end
|
||||
end
|
||||
Canvas.Darkness:DrawingEnd()
|
||||
Canvas.Darkness:Draw()
|
||||
end
|
||||
|
||||
function GameworldDrawLights()
|
||||
for _, light in pairs(LoadedObjects.Lights) do
|
||||
if light.range ~= 0 then
|
||||
love.graphics.setColor(light.color[1],light.color[2],light.color[3],1)
|
||||
for _, light in pairs(LoadedObjects.Lights) do
|
||||
if light.range ~= 0 then
|
||||
love.graphics.setColor(light.color[1],light.color[2],light.color[3],1)
|
||||
|
||||
Shader.RadiusGradient:send("pos_x",- Camera.pos.x + light.pos.x)
|
||||
Shader.RadiusGradient:send("pos_y",- Camera.pos.y + light.pos.y)
|
||||
Shader.RadiusGradient:send("range",light.range)
|
||||
Shader.RadiusGradient:send("scale",game.scale)
|
||||
Shader.RadiusGradient:send("pos_x",- Camera.pos.x + light.pos.x)
|
||||
Shader.RadiusGradient:send("pos_y",- Camera.pos.y + light.pos.y)
|
||||
Shader.RadiusGradient:send("range",light.range)
|
||||
Shader.RadiusGradient:send("scale",game.scale)
|
||||
|
||||
love.graphics.setShader(Shader.RadiusGradient)
|
||||
love.graphics.circle(
|
||||
"fill",
|
||||
- Camera.pos.x + light.pos.x,
|
||||
- Camera.pos.y + light.pos.y,
|
||||
light.range
|
||||
)
|
||||
love.graphics.setShader()
|
||||
end
|
||||
end
|
||||
love.graphics.setShader(Shader.RadiusGradient)
|
||||
love.graphics.circle(
|
||||
"fill",
|
||||
- Camera.pos.x + light.pos.x,
|
||||
- Camera.pos.y + light.pos.y,
|
||||
light.range
|
||||
)
|
||||
love.graphics.setShader()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function GameWorldUpdateLights()
|
||||
for _, light in pairs(LoadedObjects.Lights) do
|
||||
light:Flicker()
|
||||
end
|
||||
for _, light in pairs(LoadedObjects.Lights) do
|
||||
light:Flicker()
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user