summaryrefslogtreecommitdiffhomepage
path: root/not/PhysicalBody.lua
blob: bbea3acbb8869e4794c22f7c6917a04bb94b3f27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- `PhysicalBody`
-- Abstract class for drawable entity existing in `not.World`.
PhysicalBody = {
	body =--[[love.physics.newBody]]nil,
}

-- `PhysicalBody` is a child of `Sprite`.
require "not.Sprite"
PhysicalBody.__index = PhysicalBody
setmetatable(PhysicalBody, Sprite)

--[[ Constructor of `PhysicalBody`.
function PhysicalBody:new (world, x, y, imagePath)
	local o = setmetatable({}, self)
	o:init(world, x, y, imagePath)
	return o
end
]]

-- Initializator of `PhysicalBody`.
function PhysicalBody:init (world, x, y, imagePath)
	Sprite.init(self, imagePath)
end

-- Update of `PhysicalBody`.
function PhysicalBody:update (dt)
	Sprite.update(self, dt)
end

-- Draw of `PhysicalBody`.
function PhysicalBody:draw (offset_x, offset_y, scale, debug)
	-- TODO: Move debug part here from `not.Hero.draw`.
	Sprite.draw(self, offset_x, offset_y, scale)
end