`,]']±>Sï}WÿÍu§ðp8·d%qy)6o;]ÉA¦ösï÷ôôô”°ÂVl†3Sï}WÿÍu§ðp8·d%qy)6o;]ÉA¦ösï÷ôôô”°ÂVl†3ÀÌÌ ÌÌÀÌ ÌÌÀÌ ÌÌÀÌ ÌÌÌÌÀÌ ÀÀ ÌÀÀ ÀÀ ÀÀ ÀÀ ÌÀ ÀÀ ÀÀ ÌÀÀ ÀÌ ÀÀÀ ÀÀ ÀÀ ÀÀ À ÀÌ À ÀÀ ÀÀ ÀÀ ÀÀ À ÀÀ ÀÀ À ÀÀ ÀÀÀÀ À ÀÀ ÀÀ ÀÀ À ÀÀ ÀÀ ÀÀ À ÀÀ ÀÀÀÀ ÀÀ ÀÀ ÀÀ À ÀÀ ÀÀ À ÀÀ ÀÀÀÀ ÀÀ ÀÀ ÀÀ À ÀÀ ÀÀ ÀÀ À ÀÀ À ÀÀÀ ÀÀ ÀÀ À ÀÌÀ ÀÀ ÌÀÀ ÀÀ À ÀÀÀ ÀÀ ÀÀ ÌÀÀ ÀÌ À ÀÀ ÀÌ ÀÌÌÌÌ ÌÌÌÌÀÌ ÌÌÀÌ ÀÌÌÌ‹ -- title: Twenty -- author: SirWobb79 -- desc: Get to twenty to win -- license: MIT License -- version: 1 -- script: lua lives = 3 score = 0 speed = 1 level = 1 offsets = {0} hits = {} spawned = 0 delay_init = 10 ticks = 0 function display_lives() spr(256+(lives*2), 25*8, 31, 0, 1, 0, 0, 2, 2) end function display_num(num, x, y, scale, spacing) local str_num = tostring(num) local char local s = scale or 1 local s2 = spacing or 7*scale --trace(spacing) --if spacing ~= nil then s2 = spacing end --if scale ~= nil then s = scale end for i=1, #str_num do char = str_num:sub(i, i) --trace(char) if char == "1" then spr(264, x+((i-1)*s2), y, 0, s) elseif char == "2" then spr(265, x+((i-1)*s2), y, 0, s) elseif char == "3" then spr(266, x+((i-1)*s2), y, 0, s) elseif char == "4" then spr(267, x+((i-1)*s2), y, 0, s) elseif char == "5" then spr(268, x+((i-1)*s2), y, 0, s) elseif char == "6" then spr(269, x+((i-1)*s2), y, 0, s) elseif char == "7" then spr(270, x+((i-1)*s2), y, 0, s) elseif char == "8" then spr(271, x+((i-1)*s2), y, 0, s) elseif char == "9" then spr(280, x+((i-1)*s2), y, 0, s) elseif char == "0" then spr(281, x+((i-1)*s2), y, 0, s) elseif char == "e" then spr(282, x+((i-1)*s2), y, 0, s) elseif char == "+" then spr(283, x+((i-1)*s2), y, 0, s) elseif char == "-" then spr(284, x+((i-1)*s2), y, 0, s) elseif char == "." then spr(285, x+((i-1)*s2), y, 0, s) end end if num == 1/0 then spr(286, x, y, 0, s, 0, 0, 2, 1) elseif num == -1/0 then spr(284, x, y, 0, s) spr(286, x+s2, y, 0, s, 0, 0, 2, 1) end end function f(x) return math.sin(x/4)*8 end function TIC() --cls() vbank(1) map() --print(hits[1]) display_lives() pressed = btn(4) or key(48) pressedp = btnp(4) or keyp(48) delay = delay_init--/speed display_num(score, 18*8, 96, 1, 8) display_num(level, 26*8, 96, 1, 8) spr(288+offsets[1], 240-16, 64, 0, 2) spawned = spawned + 1 if math.random(1, 10) == 1 and spawned >= delay and lives ~= 0 then table.insert(hits, {256, false}) spawned = 0 end if lives == 0 and speed > -10 then speed = speed - .25 --ticks = ticks - .25 end prevspeed = speed for i, obj in ipairs(hits) do obj[1] = obj[1] - speed spr(289, -obj[1]+240-16, 64, 0, 2) if obj[1] <= 0 and obj[1] >= -16 and pressed and lives ~= 0 then score = score + 1/16 if score%5 == 0 then speed = speed + 0.5 level = level + 1 obj[1] = obj[1] * (speed/prevspeed) end --obj[2] = true --exit() table.remove(hits, i) --hits[i] = 256 end if obj[1] <= -16 then if not obj[2] and lives ~= 0 then lives = lives - 1 end table.remove(hits, i) --hits[i] = 256 end end vbank(0) cls() for x=1, 240 do line(x-1, 32+f(x-1+ticks), x, 32+f(x+ticks), 12) end if pressed then offsets[1] = 16 else offsets[1] = 0 end ticks = ticks + speed/4 end