[WIP] Triggers

- Algo de neteja de codi
This commit is contained in:
2026-04-03 20:09:30 +02:00
parent de395abb06
commit 8b516a6a26
5 changed files with 33 additions and 57 deletions

View File

@@ -13,6 +13,7 @@ require "caco"
require "zombie"
require "score"
require "switches"
require "trigger"
local tile_w = arcade_config.tiles_width
local tile_h = arcade_config.tiles_height
@@ -157,6 +158,7 @@ print("GAME INIT")
-- TRIGGERS
-- if not menu then table.insert(actors,trigger.new(10,57,32,triggers.escena_abad_inici)) end
table.insert( actors, trigger.new(10,7,3,triggers.escena_abad_inici))
-- table.insert(actors,trigger.new(11,16,32,triggers.escena_abad_corfes))
--
-- table.insert(actors,trigger.new(31,12,32,triggers.escena_abad_portes))
@@ -176,7 +178,6 @@ print("GAME INIT")
score.create()
local abad_x, abad_y = coords.room_to_world ( 10, 4, 3 )
-- local abad_x, abad_y = arc_mapa_get_coords ( 77, 3, 2 )
abad:move(abad_x, abad_y)
abad_make_safe( true )
@@ -372,11 +373,4 @@ function update_game()
-- end
end
function collision(a, b)
return (a.x+a.bb.x+a.bb.w >= b.x+b.bb.x)
and (a.x+a.bb.x <= b.x+b.bb.x+b.bb.w)
and (a.y+a.bb.y+a.bb.h >= b.y+b.bb.y)
and (a.y+a.bb.y <= b.y+b.bb.y+b.bb.h)
end
flow:registrar("game", {game_init})