23 lines
495 B
Lua
23 lines
495 B
Lua
starter={}
|
|
|
|
function starter.new(_hab,_x,_y,_scene)
|
|
return {hab=_hab,x=_x,y=_y,scene=_scene,update=starter.update,draw=starter.draw,bb={x=0,y=0,w=8,h=8}}
|
|
end
|
|
|
|
function starter:draw()
|
|
-- do nothing
|
|
--rectfill(self.x,self.y,self.x+8,self.y+8,3)
|
|
end
|
|
|
|
function starter:update()
|
|
if self.hab==abad.hab then
|
|
if aabb(abad,self) then
|
|
starter.do_touched(self)
|
|
end
|
|
end
|
|
end
|
|
|
|
function starter:do_touched()
|
|
start_scene(self.scene)
|
|
remove_actor(self)
|
|
end |