score = { points = 0, color = 28, zoom = 1, init = function() score.points = 0 end, draw = function() draw.rectf(0,0,160,8,1) draw.text(string.format("%03d", score.points),0,0,score.color) 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 }