84124d7f7b
[FIX] Corregida col·lisió en la fireball [CHG] Mogut debug a game_debug [NEW] Stage manager per a gestió de nivells
157 lines
4.9 KiB
Lua
157 lines
4.9 KiB
Lua
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
|