- Primera pasada de reorganització

This commit is contained in:
2026-03-12 17:30:56 +01:00
parent 8f185fa47c
commit 6c5d7a305a
30 changed files with 965 additions and 1096 deletions

View File

@@ -3,25 +3,24 @@ score = {
color = 28,
zoom = 1,
surf = nil,
} local me = score
init = function()
score.points = 0
score.surf = surf.load("sprites.gif")
end,
function me.init()
me.points = 0
me.surf = surf.load("gfx/sprites.gif")
end
draw = function()
draw.rectf(0,0,160,8,1)
draw.text(string.format("%03d", score.points),1,1,score.color)
surf.source(score.surf)
if sprites.hero.keys["verda"] then draw.surf(16,48,16,8, 32,-1) end
if sprites.hero.keys["groga"] then draw.surf(16,56,16,8, 32,-1) end
if sprites.hero.keys["roja"] then draw.surf(32,48,16,8, 32,-1) end
if sprites.hero.keys["blava"] then draw.surf(32,56,16,8, 32,-1) end
end,
function me.draw()
draw.rectf(0,0,160,8,1)
draw.text(string.format("%03d", me.points),1,1,me.color)
surf.source(me.surf)
if sprites.hero.keys["verda"] then draw.surf(16,48,16,8, 32,-1) end
if sprites.hero.keys["groga"] then draw.surf(16,56,16,8, 32,-1) end
if sprites.hero.keys["roja"] then draw.surf(32,48,16,8, 32,-1) end
if sprites.hero.keys["blava"] then draw.surf(32,56,16,8, 32,-1) end
end
inc = function(value)
--print("score.inc()")
score.points = score.points + value
tweening.add(8, 0, 0.5, easing.linear, function(val,progress,finished) score.color = (math.floor(val)&1) == 0 and 28 or 14 end)
end
}
function me.inc(value)
me.points = me.points + value
tweening.add(8, 0, 0.5, easing.linear, function(val,progress,finished) me.color = (math.floor(val)&1) == 0 and 28 or 14 end)
end