- All Malotes added
- Trigger system renamed and revamped - Bambolles can be poped by shooting at them
This commit is contained in:
34
trigger.lua
Normal file
34
trigger.lua
Normal 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
|
||||
Reference in New Issue
Block a user