Triggers en marxa
This commit is contained in:
@@ -92,7 +92,7 @@ function game_exit()
|
||||
end
|
||||
|
||||
function game_init(menu)
|
||||
print("GAME INIT")
|
||||
-- print("GAME INIT")
|
||||
actors={}
|
||||
|
||||
abad_init()
|
||||
@@ -158,17 +158,17 @@ 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))
|
||||
-- table.insert(actors,trigger.new(31,48,32,triggers.escena_abad_portes))
|
||||
-- table.insert(actors,trigger.new(71,56,24,triggers.escena_abad_portes))
|
||||
--
|
||||
-- table.insert(actors,trigger.new(53,40,32,triggers.escena_abad_porta_casa))
|
||||
-- table.insert(actors,trigger.new(56,32,32,triggers.escena_abad_porta_batman))
|
||||
--
|
||||
-- table.insert(actors,trigger.new(19,32,32,triggers.escena_habitacio_batman))
|
||||
table.insert( actors, trigger.new(10,7,3,triggers.escena_abad_inici,"inici"))
|
||||
table.insert( actors, trigger.new(11,2,3,triggers.escena_abad_corfes,"corfes"))
|
||||
|
||||
table.insert( actors, trigger.new(31,1,3,triggers.escena_abad_portes,"portes"))
|
||||
table.insert( actors, trigger.new(31,6,3,triggers.escena_abad_portes,"portes"))
|
||||
table.insert( actors, trigger.new(71,7,3,triggers.escena_abad_portes,"portes"))
|
||||
|
||||
table.insert( actors, trigger.new(53,5,3,triggers.escena_abad_porta_casa,"porta casa"))
|
||||
table.insert( actors, trigger.new(56,4,3,triggers.escena_abad_porta_batman,"porta batman"))
|
||||
|
||||
table.insert( actors, trigger.new(19,32,32,triggers.escena_habitacio_batman,"habitacio batman"))
|
||||
--
|
||||
-- table.insert(actors,trigger.new(14,40,32,triggers.teleport_a))
|
||||
-- table.insert(actors,trigger.new(67,8,32,triggers.teleport_b))
|
||||
@@ -183,7 +183,8 @@ print("GAME INIT")
|
||||
|
||||
local scr_ax, scr_ay = viewp:screen_coords(abad_x, abad_y)
|
||||
|
||||
game_update=update_game
|
||||
-- game_update=update_game
|
||||
flow:next()
|
||||
end
|
||||
|
||||
function render_map( sf_map, sf_tiles, x, y )
|
||||
@@ -199,49 +200,7 @@ end
|
||||
function update_game()
|
||||
surf.target(0)
|
||||
surf.cls(16)
|
||||
|
||||
-- surf.target(logo)
|
||||
-- surf.cls(16)
|
||||
-- draw.text("UPDATE_GAME",0,0,15)
|
||||
-- surf.source(logo)
|
||||
-- draw.surf(0,0,36,5,56,70,arcade_config.logo_sf.width,arcade_config.logo_sf.height)
|
||||
|
||||
--- if abad.hurting == 0 then
|
||||
--- draw_hab(abad.hab,0,0)
|
||||
--- --text(abad.hab,1,1,2)
|
||||
--- draw_hab(cameras[current_camera].hab,0,48)
|
||||
--- -- text(camera_names[current_camera],2*o2aX,49*o2aX,8)
|
||||
--- arc_textB(camera_names[current_camera],2*o2aX,49*o2aX,8)
|
||||
---
|
||||
--- score.draw()
|
||||
--- surf.source(tiles)
|
||||
--- -- draw.text("x"..abad.vides,114*o2aX,13*o2aX,2)
|
||||
--- arc_text("x"..abad.vides,114*o2aX,13*o2aX,2)
|
||||
--- draw.rectf((102+(abad.energia>>1))*o2aX,30*o2aX,(21-(abad.energia>>1))*o2aX,8*o2aX,16)
|
||||
--- else
|
||||
--- draw.surf(0,0,16*o2aX,9*o2aX,50*o2aX,40*o2aX,16*o2aX,9*o2aX,true)
|
||||
--- if abad.hurting > 40 then
|
||||
--- -- draw.text("x"..abad.vides+1,63*o2aX,43*o2aX,3)
|
||||
--- arc_text("x"..abad.vides+1,63*o2aX,43*o2aX,3)
|
||||
--- elseif abad.hurting < 20 then
|
||||
--- -- draw.text("x"..abad.vides,63*o2aX,43*o2aX,2)
|
||||
--- arc_text("x"..abad.vides,63*o2aX,43*o2aX,2)
|
||||
--- end
|
||||
--- end
|
||||
---
|
||||
--- mapa_update(abad.hab,cameras[current_camera].hab)
|
||||
|
||||
--local vp_x, vp_y = viewp:position()
|
||||
--if key.down(keyRight) then
|
||||
-- if vp_x+1<=(tile_w*mapa_room_cols*(mapa_rooms_per_piso))-(res_w) then vp_x = vp_x+1 end
|
||||
--elseif key.down(keyLeft) then
|
||||
-- if vp_x>0 then vp_x = vp_x-1 end
|
||||
--elseif key.down(keyUp) then
|
||||
-- if vp_y>0 then vp_y = vp_y -1 end
|
||||
--elseif key.down(keyDown) then
|
||||
-- if vp_y+1<=(tile_h*mapa_room_rows*mapa_pisos)-(res_h) then vp_y = vp_y+1 end
|
||||
--end
|
||||
|
||||
|
||||
if key.press(key.N1) then
|
||||
local hab = abad.hab-1
|
||||
if hab<0 then hab=0 end
|
||||
@@ -261,7 +220,7 @@ function update_game()
|
||||
local scr_ax, scr_ay = viewp:screen_coords(abad_x, abad_y)
|
||||
end
|
||||
if key.press(key.N0) then
|
||||
local abad_x, abad_y = coords.room_to_world ( 58, 3, 3 )
|
||||
local abad_x, abad_y = coords.room_to_world ( 53, 3, 3 )
|
||||
print(abad_x..", "..abad_y)
|
||||
abad:move(abad_x, abad_y)
|
||||
local scr_ax, scr_ay = viewp:screen_coords(abad_x, abad_y)
|
||||
@@ -373,4 +332,4 @@ function update_game()
|
||||
-- end
|
||||
end
|
||||
|
||||
flow:registrar("game", {game_init})
|
||||
flow:registrar("game", {game_init, update_game} )
|
||||
|
||||
Reference in New Issue
Block a user