mirror of
https://gitlab.com/MaddoScientisto/cirnofarm.git
synced 2026-06-09 13:25:54 +00:00
Refactored code
This commit is contained in:
parent
cd9ec6cc01
commit
4407ce108b
8 changed files with 128 additions and 95 deletions
24
src/actor2.lua
Normal file
24
src/actor2.lua
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
--M = {}
|
||||
|
||||
actor = {}
|
||||
actor.__index = actor
|
||||
function actor:new(x,y)
|
||||
local o = setmetatable({}, actor)
|
||||
o.x=x
|
||||
o.y=y
|
||||
o.life=100
|
||||
o.spriteIndex=0
|
||||
return o
|
||||
end
|
||||
|
||||
function actor:update()
|
||||
|
||||
end
|
||||
|
||||
function actor:draw()
|
||||
spr(self.spriteIndex,self.x,self.y)
|
||||
end
|
||||
|
||||
--M.actor = actor
|
||||
|
||||
return actor
|
||||
Loading…
Add table
Add a link
Reference in a new issue