Compare commits
2 Commits
9f97bf9160
...
1561250686
| Author | SHA1 | Date | |
|---|---|---|---|
| 1561250686 | |||
| 84124d7f7b |
+1
-1
@@ -88,7 +88,7 @@ function abad_add_mood(abad_x, spr_off_x, abad_y, spr_off_y, flip, mood)
|
||||
if mood~="normal" then
|
||||
if mood=="sorpresa" then
|
||||
mood_y = 0
|
||||
elseif mood=="enfadat" then
|
||||
elseif mood=="sobrat" then
|
||||
mood_y = 4
|
||||
elseif mood=="interessant" then
|
||||
mood_y = 8
|
||||
|
||||
+39
-28
@@ -42,6 +42,8 @@ function fireball.draw()
|
||||
end
|
||||
|
||||
function fireball.update()
|
||||
if fireball.hab == -1 then return end
|
||||
|
||||
if fireball.power==2 and fireball.power>fireball.size then
|
||||
fireball.wait = fireball.wait + 1
|
||||
fireball.x1=abad.x+abad.bb.x+(abad.bb.w//2)
|
||||
@@ -78,10 +80,8 @@ function fireball.update()
|
||||
fireball.h=fireball.w
|
||||
fireball.bb = {x=0,y=0,w=4*fireball.size,h=4*fireball.size}
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if fireball.hab == -1 then return end
|
||||
-- fireball.wait=fireball.wait+1
|
||||
|
||||
--if fireball.wait==3 then
|
||||
@@ -91,35 +91,46 @@ function fireball.update()
|
||||
-- fireball.hab=-1
|
||||
-- return
|
||||
--end
|
||||
if fireball.power==1 then
|
||||
if arc_check_tile(fireball.x,fireball.y)<tiletype.block then
|
||||
if fireball.flip then
|
||||
fireball.x=fireball.x-fireball.step_length
|
||||
else
|
||||
fireball.x=fireball.x+fireball.step_length
|
||||
end
|
||||
if fireball.power==1 then
|
||||
if arc_check_tile(fireball.x,fireball.y)<tiletype.block then
|
||||
if fireball.flip then
|
||||
fireball.x=fireball.x-fireball.step_length
|
||||
else
|
||||
fireball.hab=-1
|
||||
return
|
||||
end
|
||||
elseif fireball.power==2 then
|
||||
fireball.x = fireball.x+fireball.step_length_x
|
||||
fireball.y = fireball.y+fireball.step_length_y
|
||||
end
|
||||
|
||||
if viewp:inside(fireball.x, fireball.y, fireball.w, fireball.h) then
|
||||
if collision(fireball,abad) then
|
||||
-- if fireball.power==1 and abad.update~=abad_state_crouch then
|
||||
if fireball.power==1 then
|
||||
abad_hurt(1)
|
||||
fireball.hab=-1
|
||||
elseif fireball.power==2 then
|
||||
abad_hurt(2)
|
||||
fireball.hab=-1
|
||||
end
|
||||
fireball.x=fireball.x+fireball.step_length
|
||||
end
|
||||
else
|
||||
fireball.hab=-1
|
||||
return
|
||||
end
|
||||
elseif fireball.power==2 then
|
||||
fireball.x = fireball.x+fireball.step_length_x
|
||||
fireball.y = fireball.y+fireball.step_length_y
|
||||
end
|
||||
|
||||
if viewp:inside(fireball.x, fireball.y, fireball.w, fireball.h) then
|
||||
if collision(fireball,abad) then
|
||||
-- if fireball.power==1 and abad.update~=abad_state_crouch then
|
||||
if fireball.power==1 then
|
||||
abad_hurt(1)
|
||||
fireball.hab=-1
|
||||
elseif fireball.power==2 then
|
||||
abad_hurt(2)
|
||||
fireball.hab=-1
|
||||
end
|
||||
else
|
||||
if fireball.power==1 then
|
||||
for _, cacau_shot in pairs(cacau.shots()) do
|
||||
if cacau_shot.alive and
|
||||
collision(fireball,cacau_shot)
|
||||
then
|
||||
fireball.hab = -1
|
||||
cacau:kill(cacau_shot)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
fireball.hab=-1
|
||||
end
|
||||
--end
|
||||
end
|
||||
|
||||
+12
-297
@@ -1,4 +1,5 @@
|
||||
viewport= require("viewport")
|
||||
require "stage_mgr"
|
||||
require "abad"
|
||||
require "cacau"
|
||||
require "llibre"
|
||||
@@ -31,8 +32,6 @@ require "batvio"
|
||||
require "copter"
|
||||
require "sign"
|
||||
|
||||
local DEBUG = false
|
||||
|
||||
local tile_w = arcade_config.tiles_width
|
||||
local tile_h = arcade_config.tiles_height
|
||||
local res_w = arcade_config.resolucion.width
|
||||
@@ -40,12 +39,6 @@ local res_h = arcade_config.resolucion.height
|
||||
|
||||
local view_tile_id = false
|
||||
local view_checking_tile = false
|
||||
local stage= 1
|
||||
local stage_loaded = 0
|
||||
stage_update = nil
|
||||
stage_draw_back = nil
|
||||
stage_draw_middle = nil
|
||||
stage_draw_front = nil
|
||||
|
||||
viewp = viewport.new(arcade_config.resolucion.width, arcade_config.resolucion.height)
|
||||
viewp:position(0,0)
|
||||
@@ -123,8 +116,6 @@ function game_exit()
|
||||
end
|
||||
|
||||
function game_init(menu)
|
||||
stage= 1
|
||||
stage_loaded = 0
|
||||
-- print("GAME INIT")
|
||||
actors={}
|
||||
|
||||
@@ -132,11 +123,11 @@ function game_init(menu)
|
||||
table.insert(actors,abad)
|
||||
|
||||
score.create()
|
||||
-- game_update=update_game
|
||||
|
||||
stages.load_stage(true)
|
||||
states:next()
|
||||
end
|
||||
|
||||
|
||||
function render_map( sf_map, sf_tiles, x, y, target )
|
||||
target = target or 0
|
||||
map.surf(sf_map)
|
||||
@@ -148,47 +139,6 @@ function render_map( sf_map, sf_tiles, x, y, target )
|
||||
view.origin(0,0)
|
||||
end
|
||||
|
||||
|
||||
function load_stage()
|
||||
local stage_init = stages["stage"..stage.."_init"]
|
||||
if stage_init then
|
||||
stage_init()
|
||||
stage_loaded = stage
|
||||
stage_update = stages["stage"..stage.."_update"]
|
||||
stage_draw_back = stages["stage"..stage.."_draw_back"]
|
||||
stage_draw_middle = stages["stage"..stage.."_draw_middle"]
|
||||
stage_draw_front = stages["stage"..stage.."_draw_front"]
|
||||
print("Stage "..stage.." loaded")
|
||||
else
|
||||
print("No se ha cargado la fase "..stage)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function load_boss_stage()
|
||||
--local stage_boss = stages["stage"..stage.."_boss"]
|
||||
-- if stage_boss and not scene_running and not stages.loaded_boss then
|
||||
stage_update = stages["stage"..stage.."_boss_update"]
|
||||
stage_draw_back = stages["stage"..stage.."_boss_draw_back"]
|
||||
stage_draw_middle = stages["stage"..stage.."_boss_draw_middle"]
|
||||
stage_draw_front = stages["stage"..stage.."_boss_draw_front"]
|
||||
-- stage_boss_end = stages["stage"..stage.."_boss_end"]
|
||||
-- stage_boss()
|
||||
print("Stage "..stage.." Boss loaded")
|
||||
-- else
|
||||
-- print("No se ha cargado la fase "..stage)
|
||||
-- end
|
||||
end
|
||||
|
||||
function unload_boss_stage()
|
||||
-- stage_boss_end()
|
||||
stage_update = nil
|
||||
stage_draw_back = nil
|
||||
stage_draw_middle = nil
|
||||
stage_draw_front = nil
|
||||
-- stage_boss_end = nil
|
||||
end
|
||||
|
||||
function viewport_update()
|
||||
-- Moure el viewport
|
||||
local vp_x = viewp.x
|
||||
@@ -232,20 +182,8 @@ function world_update()
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- Xoc contra la fireball de power = 1
|
||||
if fireball.power==1 and
|
||||
viewp:inside(fireball.x, fireball.y, fireball.w, fireball.h)
|
||||
then
|
||||
for _, cacau_shot in pairs(cacau.shots()) do
|
||||
if cacau_shot.alive and collision(fireball,cacau_shot) then
|
||||
fireball.hab = -1
|
||||
cacau:kill(cacau_shot)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if stage_update then stage_update() end
|
||||
|
||||
if stages.stage_update then stages.stage_update() end
|
||||
|
||||
-- Actualizar el que queda
|
||||
cacau.update()
|
||||
@@ -261,7 +199,8 @@ function world_draw()
|
||||
render_map(sf_mapa, tiles, viewp.x, viewp.y)
|
||||
tiles_layer2.draw()
|
||||
|
||||
if stage_draw_back then stage_draw_back() end
|
||||
-- if stage_draw_back then stage_draw_back() end
|
||||
if stages.stage_draw_back then stages.stage_draw_back() end
|
||||
|
||||
-- pintar warps
|
||||
for key,warp in pairs(warp.warp_list) do
|
||||
@@ -280,17 +219,16 @@ function world_draw()
|
||||
|
||||
dialeg.draw()
|
||||
|
||||
if stage_draw_middle then stage_draw_middle() end
|
||||
-- if stage_draw_middle then stage_draw_middle() end
|
||||
if stages.stage_draw_middle then stages.stage_draw_middle() end
|
||||
|
||||
cacau:draw()
|
||||
if stage_draw_front then stage_draw_front() end
|
||||
if stages.stage_draw_front then stages.stage_draw_front() end
|
||||
|
||||
remote_view_draw()
|
||||
end
|
||||
|
||||
function update_game()
|
||||
if stage~=stage_loaded then load_stage() end
|
||||
|
||||
surf.target(0)
|
||||
surf.cls(16)
|
||||
|
||||
@@ -312,229 +250,6 @@ function update_game()
|
||||
end
|
||||
end
|
||||
|
||||
-- function pause()
|
||||
-- print("pause()")
|
||||
-- -- surf.source(0)
|
||||
-- -- surf.target(back)
|
||||
-- -- draw.surf(0,0,128,96,0,0)
|
||||
-- -- surf.target(0)
|
||||
-- -- surf.source(tiles)
|
||||
-- -- pausa_option=1
|
||||
-- -- pause_old_update=game_update
|
||||
-- -- game_update=update_pause
|
||||
-- end
|
||||
--
|
||||
-- function update_pause()
|
||||
-- draw.rectf(16,16,97,65,16)
|
||||
-- draw.rect(16,16,97,65,15)
|
||||
-- draw.text("PAUSA",54,20,15)
|
||||
--
|
||||
-- menu_count=menu_count+1
|
||||
-- local parpadeig=false
|
||||
-- if menu_count>=20 then
|
||||
-- parpadeig=true
|
||||
-- if menu_count>40 then menu_count=0 end
|
||||
-- end
|
||||
-- draw.rect(28,33+(10*(pausa_option-1)),73,9,14)
|
||||
-- if (not parpadeig) then draw.rect(28,33+(10*(pausa_option-1)),73,9,13) end
|
||||
--
|
||||
-- --draw.rect(28,33+(10*(pausa_option-1)),73,9,13)
|
||||
--
|
||||
-- draw.text("CONTINUAR",30,35,14)
|
||||
-- draw.text("MUSICA:",30,45,14)
|
||||
-- if music.enabled() then
|
||||
-- draw.text("SI",91,45,15)
|
||||
-- else
|
||||
-- draw.text("NO",91,45,15)
|
||||
-- end
|
||||
-- draw.text("SÓ:",30,55,14)
|
||||
-- if sound.enabled() then
|
||||
-- draw.text("SI",91,55,15)
|
||||
-- else
|
||||
-- draw.text("NO",91,55,15)
|
||||
-- end
|
||||
-- draw.text("EIXIR",30,65,14)
|
||||
--
|
||||
-- if key.press(key.ESCAPE) then
|
||||
-- surf.source(back)
|
||||
-- draw.surf(0,0,128,96,0,0)
|
||||
-- surf.source(tiles)
|
||||
-- game_update = pause_old_update
|
||||
-- elseif key.press(keyDown) or pad.press(btnDown) then
|
||||
-- pausa_option = pausa_option + 1
|
||||
-- if pausa_option == 5 then pausa_option = 1 end
|
||||
-- elseif key.press(keyUp) or pad.press(btnUp) then
|
||||
-- pausa_option = pausa_option - 1
|
||||
-- if pausa_option == 0 then pausa_option = 4 end
|
||||
-- elseif key.press(keyShoot) or pad.press(btnShoot) then
|
||||
-- if pausa_option==1 then
|
||||
-- surf.source(back)
|
||||
-- draw.surf(0,0,128,96,0,0)
|
||||
-- surf.source(tiles)
|
||||
-- game_update = pause_old_update
|
||||
-- elseif pausa_option==2 then
|
||||
-- music.enabled(not music.enabled())
|
||||
-- elseif pausa_option==3 then
|
||||
-- sound.enabled(not sound.enabled())
|
||||
-- else
|
||||
-- game_exit()
|
||||
-- game_init(true)
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
|
||||
function print_analisis_field ( field )
|
||||
local field_state=" "
|
||||
if boss.analisis[field] then field_state="X" end
|
||||
print(" [ "..field_state.." ] "..field)
|
||||
end
|
||||
|
||||
function print_analisis()
|
||||
print("--------------------------------------------")
|
||||
print_analisis_field("can_chase_abad")
|
||||
print_analisis_field("can_climb")
|
||||
print_analisis_field("can_shot")
|
||||
print_analisis_field("can_super")
|
||||
print_analisis_field("can_go_altar")
|
||||
print_analisis_field("falling")
|
||||
print_analisis_field("going_to_fall")
|
||||
print_analisis_field("target_reached")
|
||||
print("X= "..boss.x..", OX= "..boss.x_old)
|
||||
print(" ")
|
||||
end
|
||||
|
||||
function special_keys()
|
||||
if key.press(key.A) then
|
||||
boss.x_old = boss.x
|
||||
boss.x = boss.x-1
|
||||
print_analisis()
|
||||
end
|
||||
if key.press(key.S) then
|
||||
boss.y_old = boss.y
|
||||
boss.y = boss.y+1
|
||||
print_analisis()
|
||||
end
|
||||
if key.press(key.D) then
|
||||
-- boss.x_old = boss.x
|
||||
-- boss.x = boss.x+1
|
||||
-- print_analisis()
|
||||
dialeg.new( "Hola mundo!", abad )
|
||||
end
|
||||
if key.press(key.F) then
|
||||
-- boss.x_old = boss.x
|
||||
-- boss.x = boss.x+1
|
||||
-- print_analisis()
|
||||
dialeg.new( "Ma cuando arribo a casa", premiere )
|
||||
end
|
||||
if key.press(key.W) then
|
||||
boss.y_old = boss.y
|
||||
boss.y = boss.y-1
|
||||
print_analisis()
|
||||
end
|
||||
if key.press(key.W) then
|
||||
boss.y_old = boss.y
|
||||
boss.y = boss.y-1
|
||||
print_analisis()
|
||||
end
|
||||
if key.press(key.F) then
|
||||
boss._pause = not boss._pause
|
||||
end
|
||||
if key.press(key.N1) then
|
||||
-- abad prev room
|
||||
local hab = abad.hab-1
|
||||
if hab<0 then hab=0 end
|
||||
local hab_x = 4
|
||||
local hab_y = 3
|
||||
local abad_x, abad_y = coords.room_to_world ( hab, hab_x, hab_y)
|
||||
abad:move(abad_x, abad_y)
|
||||
local scr_ax, scr_ay = viewp:screen_coords(abad_x, abad_y)
|
||||
end
|
||||
if key.press(key.N2) then
|
||||
-- abad next room
|
||||
local hab = abad.hab+1
|
||||
if hab<0 then hab=0 end
|
||||
local hab_x = 4
|
||||
local hab_y = 3
|
||||
local abad_x, abad_y = coords.room_to_world ( hab, hab_x, hab_y)
|
||||
abad:move(abad_x, abad_y)
|
||||
local scr_ax, scr_ay = viewp:screen_coords(abad_x, abad_y)
|
||||
end
|
||||
if key.press(key.N8) then
|
||||
-- local abad_x, abad_y = coords.room_to_world ( 31, 8, 3 )
|
||||
-- print(abad_x..", "..abad_y)
|
||||
-- abad:move(abad_x, abad_y)
|
||||
-- local scr_ax, scr_ay = viewp:screen_coords(abad_x, abad_y)
|
||||
imp.mode="away"
|
||||
imp.mode_cooldown = 60000
|
||||
print("away")
|
||||
end
|
||||
if key.press(key.N9) then
|
||||
-- mapa_restore_backup()
|
||||
-- set_actors_enabled_by_room(true, "boss", 44, 55)
|
||||
-- viewp:free_move()
|
||||
imp.mode="chase"
|
||||
imp.mode_cooldown = 60000
|
||||
print("chase")
|
||||
end
|
||||
if key.press(key.N0) then
|
||||
-- abad go to room
|
||||
-- local abad_x, abad_y = coords.room_to_world ( 34, 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)
|
||||
imp.init()
|
||||
end
|
||||
end
|
||||
|
||||
function debug_info()
|
||||
-- fps_print()
|
||||
-- if true then return end
|
||||
font.current(font_default)
|
||||
-- viewp:print()
|
||||
-- msg_print(0,14,"ABAD= "..abad.x..", "..abad.y, true)
|
||||
-- msg_print(0,21,"VIEW= "..viewp.x..", "..viewp.y, true)
|
||||
local hab, xx, yy = coords.world_to_tile(abad.x, abad.y)
|
||||
msg_print(0,28,hab.." ( "..xx..", "..yy.." )", true)
|
||||
-- msg_print(0,35,hab.." ( "..xx..", "..yy.." )", true)
|
||||
-- msg_print(0,42," JH= "..abad.jump_height,true)
|
||||
|
||||
-- view_coord(abad.x+8, abad.y+0, 16, 32, 6)
|
||||
-- view_coord(abad.x+abad.bb.x, abad.y+abad.bb.h, 2, 2, 4)
|
||||
-- view_coord(abad.x+abad.bb.x+abad.bb.w, abad.y+abad.bb.h, 2, 2, 2)
|
||||
-- view_coord(abad.x, abad.y, 2, 2, 3)
|
||||
|
||||
-- if key.press(key.T) then
|
||||
-- view_tile_id = not view_tile_id
|
||||
-- view_checking_tile = false
|
||||
-- end
|
||||
-- if key.press(key.C) then
|
||||
-- view_checking_tile = not view_checking_tile
|
||||
-- view_tile_id = false
|
||||
-- end
|
||||
--
|
||||
-- if view_tile_id then
|
||||
-- write_tile(abad.x, abad.y, 0, true, "R")
|
||||
-- write_tile(abad.x, abad.y+16, 0, true, "R")
|
||||
-- write_tile(abad.x, abad.y+32, 0, true, "R")
|
||||
--
|
||||
-- write_tile(abad.x+16, abad.y+32, 0, true, "C")
|
||||
--
|
||||
-- write_tile(abad.x+32, abad.y, 0, true, "L")
|
||||
-- write_tile(abad.x+32, abad.y+16, 0, true, "L")
|
||||
-- write_tile(abad.x+32, abad.y+32, 0, true, "L")
|
||||
-- end
|
||||
--
|
||||
-- if view_checking_tile then
|
||||
-- local msg = "FLIP= true"
|
||||
-- if not abad.flip then
|
||||
-- msg ="FLIP= false"
|
||||
-- view_coord(abad.x+abad.bb.w+abad.bb.x-1, abad.y+abad.bb.h-4, 2, 2, 2)
|
||||
-- else
|
||||
-- view_coord(abad.x+abad.bb.x-1, abad.y+abad.bb.h-4, 2, 2, 2)
|
||||
-- end
|
||||
-- msg_print(abad.x, abad.y-8,msg)
|
||||
-- end
|
||||
font.current(font_sf)
|
||||
end
|
||||
|
||||
states:registrar("game", {game_init, update_game} )
|
||||
|
||||
require "game_debug"
|
||||
@@ -0,0 +1,156 @@
|
||||
DEBUG = false
|
||||
|
||||
-- DEBUG ---------------------------------------------------
|
||||
function print_analisis_field ( field )
|
||||
local field_state=" "
|
||||
if boss.analisis[field] then field_state="X" end
|
||||
print(" [ "..field_state.." ] "..field)
|
||||
end
|
||||
|
||||
function print_analisis()
|
||||
print("--------------------------------------------")
|
||||
print_analisis_field("can_chase_abad")
|
||||
print_analisis_field("can_climb")
|
||||
print_analisis_field("can_shot")
|
||||
print_analisis_field("can_super")
|
||||
print_analisis_field("can_go_altar")
|
||||
print_analisis_field("falling")
|
||||
print_analisis_field("going_to_fall")
|
||||
print_analisis_field("target_reached")
|
||||
print("X= "..boss.x..", OX= "..boss.x_old)
|
||||
print(" ")
|
||||
end
|
||||
|
||||
function special_keys()
|
||||
if key.press(key.A) then
|
||||
boss.x_old = boss.x
|
||||
boss.x = boss.x-1
|
||||
print_analisis()
|
||||
end
|
||||
if key.press(key.S) then
|
||||
boss.y_old = boss.y
|
||||
boss.y = boss.y+1
|
||||
print_analisis()
|
||||
end
|
||||
if key.press(key.D) then
|
||||
-- boss.x_old = boss.x
|
||||
-- boss.x = boss.x+1
|
||||
-- print_analisis()
|
||||
dialeg.new( "Hola mundo!", abad )
|
||||
end
|
||||
if key.press(key.F) then
|
||||
-- boss.x_old = boss.x
|
||||
-- boss.x = boss.x+1
|
||||
-- print_analisis()
|
||||
dialeg.new( "Ma cuando arribo a casa", premiere )
|
||||
end
|
||||
if key.press(key.W) then
|
||||
boss.y_old = boss.y
|
||||
boss.y = boss.y-1
|
||||
print_analisis()
|
||||
end
|
||||
if key.press(key.W) then
|
||||
boss.y_old = boss.y
|
||||
boss.y = boss.y-1
|
||||
print_analisis()
|
||||
end
|
||||
if key.press(key.F) then
|
||||
boss._pause = not boss._pause
|
||||
end
|
||||
if key.press(key.N1) then
|
||||
-- abad prev room
|
||||
local hab = abad.hab-1
|
||||
if hab<0 then hab=0 end
|
||||
local hab_x = 4
|
||||
local hab_y = 3
|
||||
local abad_x, abad_y = coords.room_to_world ( hab, hab_x, hab_y)
|
||||
abad:move(abad_x, abad_y)
|
||||
local scr_ax, scr_ay = viewp:screen_coords(abad_x, abad_y)
|
||||
end
|
||||
if key.press(key.N2) then
|
||||
-- abad next room
|
||||
local hab = abad.hab+1
|
||||
if hab<0 then hab=0 end
|
||||
local hab_x = 4
|
||||
local hab_y = 3
|
||||
local abad_x, abad_y = coords.room_to_world ( hab, hab_x, hab_y)
|
||||
abad:move(abad_x, abad_y)
|
||||
local scr_ax, scr_ay = viewp:screen_coords(abad_x, abad_y)
|
||||
end
|
||||
if key.press(key.N8) then
|
||||
-- local abad_x, abad_y = coords.room_to_world ( 31, 8, 3 )
|
||||
-- print(abad_x..", "..abad_y)
|
||||
-- abad:move(abad_x, abad_y)
|
||||
-- local scr_ax, scr_ay = viewp:screen_coords(abad_x, abad_y)
|
||||
imp.mode="away"
|
||||
imp.mode_cooldown = 60000
|
||||
print("away")
|
||||
end
|
||||
if key.press(key.N9) then
|
||||
-- mapa_restore_backup()
|
||||
-- set_actors_enabled_by_room(true, "boss", 44, 55)
|
||||
-- viewp:free_move()
|
||||
imp.mode="chase"
|
||||
imp.mode_cooldown = 60000
|
||||
print("chase")
|
||||
end
|
||||
if key.press(key.N0) then
|
||||
-- abad go to room
|
||||
-- local abad_x, abad_y = coords.room_to_world ( 34, 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)
|
||||
imp.init()
|
||||
end
|
||||
end
|
||||
|
||||
function debug_info()
|
||||
-- fps_print()
|
||||
-- if true then return end
|
||||
font.current(font_default)
|
||||
-- viewp:print()
|
||||
-- msg_print(0,14,"ABAD= "..abad.x..", "..abad.y, true)
|
||||
-- msg_print(0,21,"VIEW= "..viewp.x..", "..viewp.y, true)
|
||||
local hab, xx, yy = coords.world_to_tile(abad.x, abad.y)
|
||||
msg_print(0,28,hab.." ( "..xx..", "..yy.." )", true)
|
||||
-- msg_print(0,35,hab.." ( "..xx..", "..yy.." )", true)
|
||||
-- msg_print(0,42," JH= "..abad.jump_height,true)
|
||||
|
||||
-- view_coord(abad.x+8, abad.y+0, 16, 32, 6)
|
||||
-- view_coord(abad.x+abad.bb.x, abad.y+abad.bb.h, 2, 2, 4)
|
||||
-- view_coord(abad.x+abad.bb.x+abad.bb.w, abad.y+abad.bb.h, 2, 2, 2)
|
||||
-- view_coord(abad.x, abad.y, 2, 2, 3)
|
||||
|
||||
-- if key.press(key.T) then
|
||||
-- view_tile_id = not view_tile_id
|
||||
-- view_checking_tile = false
|
||||
-- end
|
||||
-- if key.press(key.C) then
|
||||
-- view_checking_tile = not view_checking_tile
|
||||
-- view_tile_id = false
|
||||
-- end
|
||||
--
|
||||
-- if view_tile_id then
|
||||
-- write_tile(abad.x, abad.y, 0, true, "R")
|
||||
-- write_tile(abad.x, abad.y+16, 0, true, "R")
|
||||
-- write_tile(abad.x, abad.y+32, 0, true, "R")
|
||||
--
|
||||
-- write_tile(abad.x+16, abad.y+32, 0, true, "C")
|
||||
--
|
||||
-- write_tile(abad.x+32, abad.y, 0, true, "L")
|
||||
-- write_tile(abad.x+32, abad.y+16, 0, true, "L")
|
||||
-- write_tile(abad.x+32, abad.y+32, 0, true, "L")
|
||||
-- end
|
||||
--
|
||||
-- if view_checking_tile then
|
||||
-- local msg = "FLIP= true"
|
||||
-- if not abad.flip then
|
||||
-- msg ="FLIP= false"
|
||||
-- view_coord(abad.x+abad.bb.w+abad.bb.x-1, abad.y+abad.bb.h-4, 2, 2, 2)
|
||||
-- else
|
||||
-- view_coord(abad.x+abad.bb.x-1, abad.y+abad.bb.h-4, 2, 2, 2)
|
||||
-- end
|
||||
-- msg_print(abad.x, abad.y-8,msg)
|
||||
-- end
|
||||
font.current(font_sf)
|
||||
end
|
||||
+9
-9
@@ -28,13 +28,13 @@ scene={
|
||||
|
||||
scenes={
|
||||
lluita_imp= {
|
||||
{x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"Eh!?","...","MANTE! Tu de qui eres?"},die=20},
|
||||
{x=avatar_imp_x, y=avatar_imp_y,flip=true,audio="imp",text={"","Aaaarrrrgghhh",""},die=20,musica=audio_song_imp},
|
||||
{x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"Ah! Que eres foraster","Que fas açí? Has","vingut a per pelailles?"},die=20},
|
||||
{x=avatar_imp_x, y=avatar_imp_y,flip=true,audio="imp",text={"","Grwuuuunnnn",""},die=20},
|
||||
{x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"Pos jo lo unic que","tinc es un grapat","de cacaus"},die=20},
|
||||
{x=avatar_imp_x, y=avatar_imp_y,flip=true,audio="imp",text={"","GROOOOAAAARRR",""},die=20},
|
||||
{x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"Haver parat en Alcoi!","A mi que me contes!"," CACAUS A MI!!!!"},die=20},
|
||||
{x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"Eh!?","...","MANTE! Tu de qui eres?"}, mood="estranyat"},
|
||||
{x=avatar_imp_x, y=avatar_imp_y,flip=true,audio="imp",text={"","Aaaarrrrgghhh",""},musica=audio_song_imp},
|
||||
{x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"Ah! Que eres foraster","Que fas açí? Has","vingut a per pelailles?"}},
|
||||
{x=avatar_imp_x, y=avatar_imp_y,flip=true,audio="imp",text={"","Grwuuuunnnn",""}},
|
||||
{x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"Pos jo lo unic que","tinc es un grapat","de cacaus"}},
|
||||
{x=avatar_imp_x, y=avatar_imp_y,flip=true,audio="imp",text={"","GROOOOAAAARRR",""}},
|
||||
{x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"Haver parat en Alcoi!","A mi que me contes!"," CACAUS A MI!!!!"},mood="sobrat"},
|
||||
},
|
||||
llibre_trobat={
|
||||
{x=avatar_abad2_x,y=avatar_abad_y,flip=false,audio="abad",text={"Este llibre...","Es el de les tècniques","especials dels abad..."},mood="interessant"},
|
||||
@@ -161,8 +161,8 @@ scenes={
|
||||
stage1_ending={
|
||||
{x=avatar_batman_x,y=avatar_batman_y,flip=true,audio="batman",musica=audio_song_batman,text={"Te pensaves que anaves", "a recuperar-los tan fàcil","moniato!"},die=20},
|
||||
{x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"Torna'm els meus cacaus","lladre!","Com t'agarre..."},die=20},
|
||||
{x=avatar_batman_x,y=avatar_batman_y,flip=true,audio="batman",text={"Si vols els cacaus","hauràs d'agarrar-me", ""},die=20},
|
||||
{x=avatar_batman_x,y=avatar_batman_y,flip=true,audio="batman",text={"I mes te val no tardar","perque estan bonissims", "Torradets en el seu punt"},die=20},
|
||||
{x=avatar_batman_x,y=avatar_batman_y,flip=true,audio="batman",text={"Vols els cacaus?","Ales no te'n veig", "JAJAJAJAJA"},die=20},
|
||||
{x=avatar_batman_x,y=avatar_batman_y,flip=true,audio="batman",text={"Crrrkkkk","Estan bonissims!", "Torradets en el seu punt"},die=20},
|
||||
},
|
||||
stage1_ending_2={
|
||||
{x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"elalien!","Premiere!","Que feu ací!?"},die=20},
|
||||
|
||||
+1
-22
@@ -1,10 +1,3 @@
|
||||
stages = {}
|
||||
|
||||
stages.actors={}
|
||||
stages.boss_loaded = false
|
||||
stages.boss_ready = false
|
||||
stages.boss_finished = false
|
||||
boss = nil
|
||||
|
||||
function stages.stage1_init()
|
||||
stages.actors={}
|
||||
@@ -205,9 +198,6 @@ function stages.stage1_init()
|
||||
remote_view_init()
|
||||
|
||||
viewp:free_move()
|
||||
|
||||
stages.boss_ready = false
|
||||
stages.boss_loaded = false
|
||||
end
|
||||
|
||||
function stages.stage1_toBatcave()
|
||||
@@ -232,17 +222,11 @@ function stages.stage1_toBatcave()
|
||||
-- table.insert( actors, sign.new(40, 10, 3, 0, false) ) -- R
|
||||
-- table.insert( actors, sign.new(42, 1 , 2, 90, false) ) -- D
|
||||
table.insert( stages.actors, sign.new(53, 4 , 3, 0, false) ) -- R
|
||||
print("GO TO BATCAVE")
|
||||
-- print("GO TO BATCAVE")
|
||||
end
|
||||
end
|
||||
|
||||
function stages.stage1_update()
|
||||
-- print("stage1_update")
|
||||
-- fireball.update()
|
||||
-- if (abad.energia<=abad.max_energia/2) then
|
||||
-- -- Requeriment: tindre mitja clau
|
||||
-- premiere.healer_init()
|
||||
-- end
|
||||
stages.stage1_toBatcave()
|
||||
for key,actor in pairs(stages.actors) do
|
||||
if viewp:inside(actor.x, actor.y, actor.w, actor.h) and actor~=abad then
|
||||
@@ -270,11 +254,6 @@ function stages.stage1_draw_front()
|
||||
-- boss_meter:draw()
|
||||
end
|
||||
|
||||
function stages.stage2_init()
|
||||
-- print("stage 2 init")
|
||||
end
|
||||
|
||||
-- require "stage1_maps"
|
||||
require "stage1_world_map"
|
||||
require "stage1_boss_map"
|
||||
require "stage1_boss"
|
||||
|
||||
@@ -79,8 +79,8 @@ function stages.stage1_boss_intro_init()
|
||||
boss.enabled=true
|
||||
boss.reason=""
|
||||
boss:fight()
|
||||
load_boss_stage()
|
||||
stages.boss_loaded = true
|
||||
-- load_boss_stage()
|
||||
stages.load_boss_stage()
|
||||
states:next()
|
||||
end
|
||||
|
||||
@@ -129,16 +129,12 @@ function stages.stage1_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.stage1_boss_finished()
|
||||
remove_actor(boss)
|
||||
unload_boss_stage()
|
||||
stages.unload_boss_stage()
|
||||
music.stop()
|
||||
mapa_restore_backup()
|
||||
set_actors_enabled_by_room(true, "boss", stage1_boss_mapa.r0.r, stage1_boss_mapa.r1.r)
|
||||
stages.boss_ready = false
|
||||
stages.boss_finished = false
|
||||
stages.boss_loaded = false
|
||||
viewp:free_move()
|
||||
states:finish()
|
||||
end
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
stages = {}
|
||||
|
||||
stages.stage = 1
|
||||
stages.stage_loaded = 0
|
||||
stages.last_stage = 1
|
||||
|
||||
stages.actors={}
|
||||
stages.boss_loaded = false
|
||||
stages.boss_ready = false
|
||||
stages.boss_finished = false
|
||||
boss = nil
|
||||
|
||||
stages.stage_init = nil
|
||||
stages.stage_update = nil
|
||||
stages.stage_draw_back = nil
|
||||
stages.stage_draw_middle = nil
|
||||
stages.stage_draw_front = nil
|
||||
|
||||
function stages.load_stage( init )
|
||||
init = init or false
|
||||
stages.stage_init = stages["stage"..stages.stage.."_init"]
|
||||
stages.stage_update = stages["stage"..stages.stage.."_update"]
|
||||
stages.stage_draw_back = stages["stage"..stages.stage.."_draw_back"]
|
||||
stages.stage_draw_middle = stages["stage"..stages.stage.."_draw_middle"]
|
||||
stages.stage_draw_front = stages["stage"..stages.stage.."_draw_front"]
|
||||
stages.stage_loaded = stages.stage
|
||||
stages.boss_ready = false
|
||||
stages.boss_loaded = false
|
||||
if init then stages.stage_init() end
|
||||
end
|
||||
|
||||
function stages.load_boss_stage()
|
||||
stages.stage_init = stages["stage"..stages.stage.."_boss_init"]
|
||||
stages.stage_update = stages["stage"..stages.stage.."_boss_update"]
|
||||
stages.stage_draw_back = stages["stage"..stages.stage.."_boss_draw_back"]
|
||||
stages.stage_draw_middle = stages["stage"..stages.stage.."_boss_draw_middle"]
|
||||
stages.stage_draw_front = stages["stage"..stages.stage.."_boss_draw_front"]
|
||||
stages.boss_loaded = true
|
||||
end
|
||||
|
||||
function stages.unload_boss_stage()
|
||||
stages.boss_ready = false
|
||||
stages.boss_finished = false
|
||||
stages.boss_loaded = false
|
||||
stages.load_stage(false)
|
||||
end
|
||||
|
||||
function stages.next_stage()
|
||||
stages.stage = stages.stage + 1
|
||||
if stages.stage>stages.last_stage then
|
||||
states:executar("title",false)
|
||||
else
|
||||
stages.load_stage(true)
|
||||
end
|
||||
end
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Reference in New Issue
Block a user