This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local PATH = ....."." | |
local dirPATH = PATH:gsub("%.","/") | |
local helium = require("Lib.helium") | |
local lg = love.graphics | |
local function resize(element, w, h) | |
if element.anchor then | |
local v = element.view | |
v.x, v.y, v.w, v.h = element.anchor:getRect(w, h) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local lg, lm = love.graphics, love.math | |
local infected = {0.8,0.2,0.2} | |
local normal = {0.4,0.4,0.7} | |
local radius, speed = 5, 75 | |
local circles = {} | |
for i=1, 100 do | |
circles[i] = { | |
x = lm.random(radius, lg.getWidth()-radius), | |
y = lm.random(radius, lg.getHeight()-radius), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
love.graphics.setColorHex = function(r, g, b, a) | |
r,g,b,a = r or 255, g or 255, b or 255, a or 255 | |
assert(r <=255 and r >= 0, "Given R value is not in the range of 0-255") | |
assert(g <=255 and g >= 0, "Given G value is not in the range of 0-255") | |
assert(b <=255 and b >= 0, "Given B value is not in the range of 0-255") | |
assert(a <=255 and a >= 0, "Given A value is not in the range of 0-255") | |
love.graphics.setColor(r/255,g/255,b/255,a/255) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local lg = love.graphics | |
local canvas = lg.newCanvas(128,128) -- treat canvas as your sprite, but I was too lazy to draw a debug image, so I made one from a canvas | |
lg.setCanvas(canvas) -- French flag debug graphic | |
lg.clear(1,1,1) | |
lg.setColor(0.2,0.2,0.8) | |
lg.rectangle("fill", 0, 0, 43,128) | |
lg.setColor(0.8,0.2,0.2) | |
lg.rectangle("fill",88,0, 43,128) | |
lg.setColor(1,1,1) | |
lg.setCanvas() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local lily = require("Lib.Lily") | |
local global = require("Scripts.global") | |
local file = require("Scripts.Utilities.file") | |
local insert = table.insert | |
local lilyLoaders = { | |
png = "newImage", | |
jpg = "newImage", | |
jpeg = "newImage", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local maths = {} | |
function maths.cross(ux, uy, uz, vx, vy, vz) | |
local nx = (uy*vz) - (uz*vy) | |
local ny = (uz*vx) - (ux*vz) | |
local nz = (ux*vy) - (uy*vx) | |
return nx, ny, nz | |
end | |
function maths.dot(ux, uy, uz, vx, vy, vz) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local pixelArt = function(asset) | |
asset:setFilter("nearest","nearest") | |
end | |
local assets = { | |
{"red","assets/red.png",onload=pixelArt}, | |
{"red","assets/red.png",onload=pixelArt}, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local lg, lt = love.graphics, love.touch | |
local insert, remove = table.insert, table.remove | |
local sqrt = math.sqrt | |
local x,y, w,h = love.window.getSafeArea() | |
local textW, textH = x+w,y+h | |
local a, b = textW/2, textH/2 | |
local texture = lg.newCanvas(textW,textH) | |
lg.setCanvas(texture) | |
lg.setColor(.5,.5,.5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
; new file type | |
[HKEY_CLASSES_ROOT\.lua] | |
@="lua" | |
; template | |
[HKEY_CLASSES_ROOT\.lua\ShellNew] | |
"FileName"="" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local scene = {} | |
-- all functions are the same as love.* (except scene.unload) but put them in a scene table and return it at the end | |
scene.load = function() | |
scene.img = love.graphics.newImage("logo.png") | |
end | |
scene.unload = function() -- only custom function added, called before switching scenes | |
scene.img = nil -- unload image when leaving the scene as we will never return back to this splash screen | |
-- if you're switching between the game and another scene back and forth you won't need to keep loading the images | |
-- therefore check if they're already loaded in `scene.load` otherwise you will be |