Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

40 lines (31 sloc) 0.706 kb
Boom = {}
function Boom:new(x, y)
return setmetatable({
x = x,
y = y,
duration = 1,
size = 50,
dead = false
}, {__index = self})
end
function Boom:advance(dt)
self.duration = self.duration - dt
if self.duration < 0 then
self.dead = true
end
end
function Boom:collide()
end
function Boom:draw()
local r, g, b, a = love.graphics.getColor()
love.graphics.setColor(
math.random() * 255,
math.random() * 255,
math.random() * 255,
self.duration * 255)
love.graphics.circle(
'fill',
self.x, self.y,
self.size * self.duration)
love.graphics.setColor(r, g, b, a)
end
Jump to Line
Something went wrong with that request. Please try again.