Skip to content

Instantly share code, notes, and snippets.

@fkaa
Created September 19, 2014 20:20
Show Gist options
  • Select an option

  • Save fkaa/358d4d79b5b94b39e7c1 to your computer and use it in GitHub Desktop.

Select an option

Save fkaa/358d4d79b5b94b39e7c1 to your computer and use it in GitHub Desktop.
Entity = {
x = 0, y = 0,
w = 0, h = 0,
vx = 0, vy = 0,
drawable = nil
}
function Entity:new(o)
local o = o or {}
setmetatable(o, self)
self.__index = self
return o
end
function Entity:draw()
end
function Entity:update(dt)
end
Bunny = Entity:new()
function Bunny:new(x, y)
self.x = x
self.y = y
self.width = 6
self.height = 9
end
function Bunny:update(dt)
end
function Bunny:draw()
drawable:draw(self.x, self.y)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment