mirror of
https://gitlab.com/MaddoScientisto/cirnofarm.git
synced 2026-06-09 04:05:54 +00:00
Proper actors implementation
This commit is contained in:
parent
4407ce108b
commit
6a7e938a39
5 changed files with 88 additions and 68 deletions
|
|
@ -1,4 +1,4 @@
|
|||
--local actor = require("actor2")
|
||||
local Actor = require(make_path("actor2"))
|
||||
|
||||
-- barrel = setmetatable({}, {__index = actor})
|
||||
-- function barrel:new(actor)
|
||||
|
|
@ -9,25 +9,18 @@
|
|||
|
||||
-- return barrel
|
||||
|
||||
barrel = {}
|
||||
barrel.__index = barrel
|
||||
function barrel:new(x,y)
|
||||
local o = setmetatable({}, barrel)
|
||||
o.x=x
|
||||
o.y=y
|
||||
o.life=100
|
||||
o.spriteIndex=0
|
||||
return o
|
||||
end
|
||||
Barrel = Actor:new()
|
||||
Barrel.spriteIndex = 3
|
||||
|
||||
function barrel:update()
|
||||
|
||||
function Barrel:update()
|
||||
|
||||
end
|
||||
|
||||
function barrel:draw()
|
||||
spr(self.spriteIndex,self.x,self.y)
|
||||
end
|
||||
--function Barrel:draw()
|
||||
-- spr(self.spriteIndex,self.x,self.y)
|
||||
--end
|
||||
|
||||
--M.actor = actor
|
||||
|
||||
return barrel
|
||||
return Barrel
|
||||
Loading…
Add table
Add a link
Reference in a new issue