summaryrefslogtreecommitdiff
path: root/spike.lua
blob: c6a28319d4681005a79d28b92b82e0beaffdd7fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
local Entity = require("entity")
local Spike = {}
Spike.__index = Spike
setmetatable(Spike, { __index = Entity })

function Spike.new(entity)
    local self = setmetatable(Entity:new(entity.x, entity.y, entity.width, entity.height), Spike)
    self.isSpike = true
    return self
end

function Spike:setWorldPhysics(world)
    self:enablePhysics(world, "static")
end

function Spike:update(dt)
    self:syncFromPhysicsBody()
end

function Spike:draw()
end

return Spike