e0825e5bbb
[NEW] Afegit music_player [NEW] Música de fons des de l'inici
67 lines
1.5 KiB
Lua
67 lines
1.5 KiB
Lua
-- stages = {}
|
|
|
|
-- stages.actors={}
|
|
|
|
function stages.stage2_init()
|
|
-- stagemgr init
|
|
stages.actors={}
|
|
stages.boss_loaded = false
|
|
stages.boss_ready = false
|
|
stages.boss_finished = false
|
|
boss = nil
|
|
actors={}
|
|
|
|
-- mapa init
|
|
mapa = stage2_mapa
|
|
tiletype={void=0,nonpc=1,stair=2,switch=3,half=4,block=5}
|
|
mapa.wait=0
|
|
mapa.step=0
|
|
surf.free(sf_mapa)
|
|
sf_mapa=surf.new(s2_mapa_room_cols*s2_mapa_rooms_per_piso,s2_mapa_room_rows*s2_mapa_pisos)
|
|
load_tilemap( sf_mapa )
|
|
|
|
-- actors init
|
|
batvio.init()
|
|
table.insert(actors,batvio)
|
|
|
|
-- abad init
|
|
local abad_x, abad_y = coords.room_to_world ( 1, 4, 3 )
|
|
abad:move(abad_x, abad_y)
|
|
abad_make_safe( true )
|
|
|
|
-- viewport init
|
|
local scr_ax, scr_ay = viewp:screen_coords(abad_x, abad_y)
|
|
viewp:free_move()
|
|
|
|
-- remote_view_init()
|
|
end
|
|
|
|
function stages.stage2_update()
|
|
for key,actor in pairs(stages.actors) do
|
|
if viewp:inside(actor.x, actor.y, actor.w, actor.h) and actor~=abad then
|
|
actor:update()
|
|
end
|
|
end
|
|
end
|
|
|
|
function stages.stage2_draw_back()
|
|
for key,actor in pairs(stages.actors) do
|
|
if viewp:inside(actor.x, actor.y, actor.w, actor.h) and actor~=abad then
|
|
actor:draw()
|
|
end
|
|
end
|
|
end
|
|
|
|
function stages.stage2_draw_middle()
|
|
|
|
end
|
|
|
|
function stages.stage2_draw_front()
|
|
|
|
end
|
|
|
|
require "stage2_world_map"
|
|
require "stage2_boss_map"
|
|
require "stage2_boss"
|
|
require "stage2_ending"
|