- Reset game on death
This commit is contained in:
13
main.lua
13
main.lua
@@ -24,6 +24,11 @@ function _init()
|
||||
local pal=loadpal("tiles.gif")
|
||||
setpal(pal)
|
||||
|
||||
actors={}
|
||||
cameras={}
|
||||
camera_names={[0]="GPS","Gorro","Peu de Paco","Premiere","EL_ALIEN","BatMan"}
|
||||
current_camera=0
|
||||
|
||||
-- ACTORS PRINCIPALS
|
||||
abad_init()
|
||||
table.insert(actors,abad)
|
||||
@@ -70,6 +75,7 @@ function _init()
|
||||
-- TRIGGERS
|
||||
table.insert(actors,trigger.new(10,44,32,triggers.escena_abad_inici))
|
||||
table.insert(actors,trigger.new(11,16,32,triggers.escena_abad_corfes))
|
||||
table.insert(actors,trigger.new(19,32,32,triggers.escena_habitacio_batman))
|
||||
score.create()
|
||||
|
||||
cameras[0]=gps
|
||||
@@ -242,6 +248,13 @@ function update_game()
|
||||
end
|
||||
end
|
||||
|
||||
function game_exit()
|
||||
mapa_restore_backup()
|
||||
freesurf(tiles)
|
||||
actors={}
|
||||
cameras={}
|
||||
end
|
||||
|
||||
function aabb(a, b)
|
||||
return (a.x+a.bb.x+a.bb.w >= b.x+b.bb.x) and (a.x+a.bb.x <= b.x+b.bb.x+b.bb.w) and (a.y+a.bb.y+a.bb.h >= b.y+b.bb.y) and (a.y+a.bb.y <= b.y+b.bb.y+b.bb.h)
|
||||
end
|
||||
Reference in New Issue
Block a user