Explosion = class(CenteredObject, function(o, x, y, maxSize)
	CenteredObject.init(o, x, y, 10, 10)
	o.max = maxSize or 1.5
	if r_scale == 4 then
		o.max = o.max * 2
	end
	o.sprite = sprites['tiles']['circle.png']
	o.scale = 0
	Tweener:addTween(o, {scale=o.max}, {time=1.5})
end)
function Explosion:update()
	-- self.scale = (self.scale + bludG.elapsed) * 1.01
	if self.scale > self.max*0.66 and not self.colorTween then
		self.colorTween = Tweener:addTween(self.tint, {r=0, g=0, b=0, a=0}, {time=0.5})
	end
	if self.tint.a <= 0 then
		self:kill()
	end
end
Flash = class(Object, function(o, duration, color)
	Object.init(o, 0,0,bludG.camera.w, bludG.camera.h)
	if color then
		o:setColor(color.r, color.g, color.b, color.a or 255)
	else
		o:setColor(255, 255, 255)
	end
	o.scrollFactor = Vec2(0,0)
	o.drawType = 'stretched'
	o.sprite = sprites['tiles']['white.png']
	o.fadeTween = Tweener:addTween(o.tint, {a=0, g=0}, {time=duration or 1, onComplete=function() o.exists = false; end})
end)

DeathSpin = class(CenteredObject, function(o, x, y, sprite, tint, sheet, flip)
	CenteredObject.init(o, x, y, 20, 20)
	o.sprite = sprite
	if r_scale == 4 then
		o.scale = 2
	end
	o.flip = flip
	o.sheet = sheet
	o:setColor(tint.r, tint.g, tint.b, 255)
	o.fadeTween = Tweener:addTween(o.tint, {a=0, g=0}, {time=duration or 2, onComplete=function() o.exists = false; end})
	o.moves = true
	o.velocity = Vec2(math.random(-50, 50), math.random(-50, 50))
	o.rotVel = math.random(-15, 15)
	o.acceleration.y = 200
end)
function DeathSpin:update()
	Object.update(self)
	self.rot = self.rotVel + self.rot
end
