[WIP] Afegint codi per a múltiples fases
This commit is contained in:
@@ -16,6 +16,8 @@ require "switches"
|
||||
require "trigger"
|
||||
require "imp"
|
||||
|
||||
require "stage1"
|
||||
|
||||
local tile_w = arcade_config.tiles_width
|
||||
local tile_h = arcade_config.tiles_height
|
||||
local res_w = arcade_config.resolucion.width
|
||||
@@ -23,6 +25,8 @@ local res_h = arcade_config.resolucion.height
|
||||
|
||||
local view_tile_id = false
|
||||
local view_checking_tile = false
|
||||
local stage= 1
|
||||
local stage_loaded = 0
|
||||
|
||||
viewp = viewport.new(arcade_config.resolucion.width, arcade_config.resolucion.height)
|
||||
viewp:position(0,0)
|
||||
@@ -204,6 +208,17 @@ function render_map( sf_map, sf_tiles, x, y )
|
||||
end
|
||||
|
||||
function update_game()
|
||||
if stage~=stage_loaded then
|
||||
local stage_init = stages["stage"..stage.."_init"]
|
||||
if stage_init then
|
||||
stage_init()
|
||||
stage_loaded = stage
|
||||
print("Stage "..stage.." loaded")
|
||||
else
|
||||
print("No se ha cargado la fase "..stage)
|
||||
end
|
||||
end
|
||||
|
||||
surf.target(0)
|
||||
surf.cls(16)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user