[NEW] Comprovació de la versió de mini abans d'arrancar el joc
[FIX] Eliminats fitxers que ja no valien [WIP] Stage 2
This commit is contained in:
@@ -0,0 +1,129 @@
|
||||
stage2_boss ={
|
||||
time = 0,
|
||||
out_x = 0,
|
||||
out_y = 0,
|
||||
out_speed = 8,
|
||||
}
|
||||
|
||||
function stages.stage2_boss_ready()
|
||||
print("READY")
|
||||
stages.boss_ready = true
|
||||
stages.boss_finished = false
|
||||
end
|
||||
|
||||
function stages.stage2_boss_update()
|
||||
-- print("stage2_update")
|
||||
fireball.update()
|
||||
-- if (abad.energia<=abad.max_energia/2) then
|
||||
-- -- Requeriment: tindre mitja clau
|
||||
-- premiere.healer_init()
|
||||
-- end
|
||||
end
|
||||
|
||||
function stages.stage2_boss_draw_back()
|
||||
-- print("stage2_draw_back")
|
||||
end
|
||||
|
||||
function stages.stage2_boss_draw_middle()
|
||||
-- print("stage2_draw_middle")
|
||||
end
|
||||
|
||||
function stages.stage2_boss_draw_front()
|
||||
-- print("stage2_draw_front")
|
||||
fireball.draw()
|
||||
boss_meter:draw()
|
||||
end
|
||||
|
||||
function stages.stage2_boss_finished()
|
||||
stages.boss_ready = true
|
||||
stages.boss_finished = true
|
||||
end
|
||||
|
||||
-- INTRO FUNCTIONS
|
||||
function stages.stage2_boss_intro_init()
|
||||
trigger_event.new("Premiere Boss 1",
|
||||
trigger_ev.premiere_boss1_trigger,
|
||||
trigger_ev.premiere_healer_init,
|
||||
premiere.healer_update)
|
||||
load_tilemap( sf_mapa, stage2_boss_mapa )
|
||||
set_actors_enabled_by_room(false, "boss", stage2_boss_mapa.r0.r, stage2_boss_mapa.r1.r)
|
||||
viewp:fixed({l=8,r=44,u=0,d=0}, viewp.x, viewp.y-48)
|
||||
boss.enabled=true
|
||||
boss.reason=""
|
||||
boss:fight()
|
||||
load_boss_stage()
|
||||
stages.boss_loaded = true
|
||||
states:next()
|
||||
end
|
||||
|
||||
function stages.stage2_boss_intro_update()
|
||||
if stage2_boss.time==0 then
|
||||
start_scene(scenes.lluita_imp, nil, false)
|
||||
stages.stage2_boss_ready()
|
||||
end
|
||||
|
||||
-- Acabar
|
||||
if stage2_boss.time>=1 then
|
||||
states:next()
|
||||
end
|
||||
|
||||
stage2_boss.time = stage2_boss.time + 1
|
||||
end
|
||||
|
||||
function stages.stage2_boss_intro_end()
|
||||
stage2_boss.out_x = 0
|
||||
stage2_boss.out_y = 0
|
||||
stage2_boss.out_speed = 12
|
||||
states:finish()
|
||||
end
|
||||
|
||||
-- OUTRO FUNCTION
|
||||
function stages.stage2_boss_outro_update()
|
||||
stage2_boss.time = stage2_boss.time + 1
|
||||
-- black out
|
||||
if stage2_boss.time%stage2_boss.out_speed==0 then
|
||||
if stage2_boss.out_x==8 then
|
||||
stage2_boss.out_x = 0
|
||||
stage2_boss.out_y = stage2_boss.out_y+1
|
||||
end
|
||||
|
||||
draw.rectf(stage2_boss.out_x*32,stage2_boss.out_y*32,32,32,16)
|
||||
stage2_boss.out_x = stage2_boss.out_x +1
|
||||
if stage2_boss.out_speed>1 then stage2_boss.out_speed = stage2_boss.out_speed -1 end
|
||||
end
|
||||
|
||||
if stage2_boss.out_y>=6 then
|
||||
states:next()
|
||||
end
|
||||
end
|
||||
|
||||
function stages.stage2_boss_outro_end()
|
||||
local abad_x, abad_y = coords.room_to_world ( 54, 9, 3 )
|
||||
abad:move(abad_x, abad_y)
|
||||
abad_make_safe( true )
|
||||
|
||||
stages.stage2_boss_finished()
|
||||
remove_actor(boss)
|
||||
unload_boss_stage()
|
||||
music.stop()
|
||||
mapa_restore_backup()
|
||||
set_actors_enabled_by_room(true, "boss", stage2_boss_mapa.r0.r, stage2_boss_mapa.r1.r)
|
||||
stages.boss_ready = false
|
||||
stages.boss_finished = false
|
||||
stages.boss_loaded = false
|
||||
viewp:free_move()
|
||||
states:finish()
|
||||
end
|
||||
|
||||
|
||||
-- STATES REGISTRY
|
||||
states:registrar("stage2_boss_intro",{
|
||||
stages.stage2_boss_intro_init,
|
||||
stages.stage2_boss_intro_update,
|
||||
stages.stage2_boss_intro_end
|
||||
})
|
||||
|
||||
states:registrar("stage2_boss_outro",{
|
||||
stages.stage2_boss_outro_update,
|
||||
stages.stage2_boss_outro_end
|
||||
})
|
||||
Reference in New Issue
Block a user