- All Malotes added

- Trigger system renamed and revamped
- Bambolles can be poped by shooting at them
This commit is contained in:
2022-10-28 17:10:33 +02:00
parent 0ef6d03ec1
commit 8d95eb10e1
6 changed files with 67 additions and 33 deletions

34
trigger.lua Normal file
View File

@@ -0,0 +1,34 @@
trigger={}
function trigger.new(_hab,_x,_y,_fun)
return {hab=_hab,x=_x,y=_y,fun=_fun,update=trigger.update,draw=trigger.draw,bb={x=0,y=0,w=8,h=8}}
end
function trigger:draw()
-- do nothing
--rectfill(self.x,self.y,self.x+8,self.y+8,3)
end
function trigger:update()
if self.hab==abad.hab then
if aabb(abad,self) then
self:fun()
end
end
end
--function trigger:do_touched()
-- start_scene(self.scene)
-- remove_actor(self)
--end
triggers={}
function triggers:escena_abad_inici()
start_scene(scenes.abad_inici)
remove_actor(self)
end
function triggers:escena_abad_corfes()
start_scene(scenes.abad_corfes)
remove_actor(self)
end