Something went wrong. Try again.
A Love2D remaster of my bug-catching-cult-classic Bait and Switch
Something went wrong. Try again.
738 B · 30 lines
Lua
at main
123456789101112131415161718192021222324252627282930utils = {}
function utils.lerp(a, b, t) return a + (b - a) * tend
function utils.drawWithShadow(sprite, x, y, angle, sx, sy, ox, oy, shadowOffset, shadowColor, tint) -- Default values sx = sx or 1 sy = sy or sx angle = angle or 0 ox = ox or 0 oy = oy or 0 shadowOffset = shadowOffset or 3 shadowColor = shadowColor or {0, 0, 0, 1} -- Draw shadow love.graphics.setColor(shadowColor) love.graphics.draw(sprite, x + shadowOffset, y + shadowOffset, angle, sx, sy, ox, oy) -- Draw main sprite if tint then love.graphics.setColor(tint) else love.graphics.setColor(1, 1, 1) end love.graphics.draw(sprite, x, y, angle, sx, sy, ox, oy)end
return utils