[WIP] Lluita contra jefes
This commit is contained in:
101
data/game.lua
101
data/game.lua
@@ -18,6 +18,8 @@ require "imp"
|
||||
|
||||
require "stage1"
|
||||
|
||||
local DEBUG = true
|
||||
|
||||
local tile_w = arcade_config.tiles_width
|
||||
local tile_h = arcade_config.tiles_height
|
||||
local res_w = arcade_config.resolucion.width
|
||||
@@ -103,95 +105,7 @@ function game_init(menu)
|
||||
abad_init()
|
||||
table.insert(actors,abad)
|
||||
|
||||
llibre.init()
|
||||
table.insert(actors,llibre)
|
||||
|
||||
gorro.init()
|
||||
table.insert(actors,gorro)
|
||||
|
||||
peu.init()
|
||||
table.insert(actors,peu)
|
||||
|
||||
premiere.init()
|
||||
table.insert(actors,premiere)
|
||||
|
||||
elalien.init()
|
||||
table.insert(actors,elalien)
|
||||
|
||||
imp.init()
|
||||
table.insert(actors,imp)
|
||||
|
||||
--batman
|
||||
|
||||
bol.init()
|
||||
table.insert(actors,bol)
|
||||
|
||||
table.insert( actors, gota.new(70,5,1,20) )
|
||||
table.insert( actors, gota.new(70,9,1,30) )
|
||||
table.insert( actors, gota.new(63,5,1,25,2,-7) )
|
||||
table.insert( actors, gota.new(63,9,1,20,0,-8) )
|
||||
table.insert( actors, gota.new(64,3,1,10,0,-6) )
|
||||
table.insert( actors, gota.new(64,6,1,25,-1,-5) )
|
||||
table.insert( actors, gota.new(65,7,1,10,0,-7) )
|
||||
table.insert( actors, gota.new(65,8,1,25,0,-7) )
|
||||
table.insert( actors, gota.new(66,3,1,10,0,-7) )
|
||||
table.insert( actors, gota.new(66,4,1,15,0,-7) )
|
||||
table.insert( actors, gota.new(77,2,1,30,-5,-7) )
|
||||
table.insert( actors, gota.new(77,9,1,25,-5,-7) )
|
||||
|
||||
-- FOC?
|
||||
table.insert(actors,invisible.new(77,5,4))
|
||||
table.insert(actors,invisible.new(77,6,4))
|
||||
table.insert(actors,invisible.new(58,2,4))
|
||||
table.insert(actors,invisible.new(58,3,4))
|
||||
|
||||
table.insert( actors, caco.new(13,3,2,true ) )
|
||||
table.insert( actors, caco.new(17,3,2,false) )
|
||||
table.insert( actors, caco.new(20,3,2,false) )
|
||||
table.insert( actors, caco.new(26,3,2,false) )
|
||||
table.insert( actors, caco.new(37,3,2,false) )
|
||||
table.insert( actors, caco.new(41,3,2,false) )
|
||||
table.insert( actors, caco.new(50,3,2,false) )
|
||||
table.insert( actors, caco.new(57,3,2,false) )
|
||||
table.insert( actors, caco.new(61,3,2,false) )
|
||||
|
||||
table.insert( actors, zombie.new(2, 3, 3,false) )
|
||||
table.insert( actors, zombie.new(28, 3, 3,false) )
|
||||
table.insert( actors, zombie.new(32, 3, 3,false) )
|
||||
table.insert( actors, zombie.new(44, 3, 3,false) )
|
||||
table.insert( actors, zombie.new(46, 3, 3,false) )
|
||||
table.insert( actors, zombie.new(54, 3, 3,false) )
|
||||
table.insert( actors, zombie.new(68, 3, 3,false) )
|
||||
table.insert( actors, zombie.new(73, 3, 3,false) )
|
||||
|
||||
-- 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,"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(55,1,3,triggers.escena_lluita_imp,"lluita imp"))
|
||||
-- table.insert(actors,trigger.new(14,40,32,triggers.teleport_a))
|
||||
-- table.insert(actors,trigger.new(67,8,32,triggers.teleport_b))
|
||||
-- table.insert(actors,trigger.new(29,40,32,triggers.teleport_c))
|
||||
-- table.insert(actors,trigger.new(61,8,32,triggers.teleport_d))
|
||||
|
||||
score.create()
|
||||
|
||||
local abad_x, abad_y = coords.room_to_world ( 10, 4, 3 )
|
||||
-- local abad_x, abad_y = coords.room_to_world ( 54, 8, 3 )
|
||||
abad:move(abad_x, abad_y)
|
||||
abad_make_safe( true )
|
||||
|
||||
local scr_ax, scr_ay = viewp:screen_coords(abad_x, abad_y)
|
||||
|
||||
-- game_update=update_game
|
||||
flow:next()
|
||||
@@ -219,6 +133,7 @@ function load_stage()
|
||||
end
|
||||
|
||||
function viewport_update()
|
||||
-- Moure el viewport
|
||||
local vp_x = viewp.x
|
||||
local vp_y = viewp.y
|
||||
|
||||
@@ -288,19 +203,19 @@ function update_game()
|
||||
|
||||
surf.target(0)
|
||||
surf.cls(16)
|
||||
|
||||
-- special_keys()
|
||||
|
||||
world_update()
|
||||
|
||||
-- Moure el viewport
|
||||
viewport_update()
|
||||
|
||||
world_draw()
|
||||
|
||||
score.draw()
|
||||
|
||||
-- debug_info()
|
||||
if DEBUG then
|
||||
special_keys()
|
||||
debug_info()
|
||||
end
|
||||
end
|
||||
|
||||
function pause()
|
||||
@@ -397,7 +312,7 @@ function special_keys()
|
||||
end
|
||||
if key.press(key.N0) then
|
||||
-- abad go to room
|
||||
local abad_x, abad_y = coords.room_to_world ( 70, 6, 3 )
|
||||
local abad_x, abad_y = coords.room_to_world ( 54, 6, 3 )
|
||||
print(abad_x..", "..abad_y)
|
||||
abad:move(abad_x, abad_y)
|
||||
local scr_ax, scr_ay = viewp:screen_coords(abad_x, abad_y)
|
||||
|
||||
Reference in New Issue
Block a user