- [NEW] El marcador s'amaga quan mors
- [NEW] Al morir i apagar-se tot, les llums s'encenen de cero a normal de nou al reviure
This commit is contained in:
@@ -6,8 +6,9 @@ score = {
|
||||
font = nil
|
||||
} local me = score
|
||||
|
||||
function me.init()
|
||||
me.points = 0
|
||||
function me.init(reinit)
|
||||
if not reinit then me.points = 0 end
|
||||
me.ypos = 3
|
||||
me.surf = surf.load("gfx/sprites.gif")
|
||||
me.font = font.load("gfx/score_font.fnt")
|
||||
end
|
||||
@@ -45,13 +46,16 @@ local function draw_key(sx,sy,dx,dy)
|
||||
end
|
||||
|
||||
function me.draw()
|
||||
if sprites.hero.state == templates.DEAD then
|
||||
if me.ypos > -100 then me.ypos=me.ypos-1 end
|
||||
end
|
||||
view.origin(0,0)
|
||||
surf.target(0)
|
||||
view.clip()
|
||||
|
||||
draw_text()
|
||||
|
||||
local y = 3
|
||||
local y = score.ypos
|
||||
if sprites.hero.keys["verda"] then draw_key(16,48,140,y) y=y+8 end
|
||||
if sprites.hero.keys["groga"] then draw_key(16,56,140,y) y=y+8 end
|
||||
if sprites.hero.keys["roja"] then draw_key(32,48,140,y) y=y+8 end
|
||||
|
||||
@@ -124,6 +124,9 @@ function sprites.lights_out()
|
||||
spr.light = value
|
||||
if finished then
|
||||
spr.light = nil
|
||||
if sprites.hero.state == templates.DEAD then
|
||||
game.restart()
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
@@ -36,6 +36,16 @@ game = {
|
||||
--shader.enable();
|
||||
end,
|
||||
|
||||
restart = function()
|
||||
rooms.reload()
|
||||
sprites.add_from_room(rooms.pos.x, rooms.pos.y)
|
||||
pal.set(palfade.original)
|
||||
ia.hero_reset()
|
||||
sprites.hero.light = 0
|
||||
tweening.add(0,100,1,easing.linear,function(value,n,finished)sprites.hero.light = value end)
|
||||
score.init(true)
|
||||
end,
|
||||
|
||||
update = function()
|
||||
game.water_counter = game.water_counter + 0.05
|
||||
|
||||
|
||||
Reference in New Issue
Block a user