2024-04-25 23:07:49 +02:00
|
|
|
--M = {}
|
|
|
|
|
|
2024-04-26 11:22:51 +02:00
|
|
|
Actor = {
|
|
|
|
|
life=100,
|
|
|
|
|
spriteIndex=0,
|
|
|
|
|
}
|
|
|
|
|
--actor.__index = actor
|
|
|
|
|
function Actor:new(new_x,new_y)
|
|
|
|
|
local o = {
|
|
|
|
|
x=new_x,
|
2024-04-26 14:24:25 +02:00
|
|
|
y=new_y,
|
|
|
|
|
w=16,
|
|
|
|
|
h=16
|
2024-04-26 11:22:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return setmetatable(o, {__index=self})
|
2024-04-25 23:07:49 +02:00
|
|
|
end
|
|
|
|
|
|
2024-04-26 11:22:51 +02:00
|
|
|
function Actor:update()
|
2024-04-25 23:07:49 +02:00
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
2024-04-26 11:22:51 +02:00
|
|
|
function Actor:draw()
|
2024-04-25 23:07:49 +02:00
|
|
|
spr(self.spriteIndex,self.x,self.y)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--M.actor = actor
|
|
|
|
|
|
2024-04-26 11:22:51 +02:00
|
|
|
return Actor
|