0,e<4±>Sï}WÿÍu§ðp8·d%qy)6o;]ÉA¦ö8(ôôô”°ÂVl†3?002579;=??????????????????????€„„„„„ „ „ „„„ „ „ „ „ „„„„ „ „„„„„„ „ „ „ „ „ „ „ „ „ „ „ „ „ „ „ „ „„„„ „ „ „ „ „ „ „ „„„„ „ „ „ „ „ „ „„„„„„„ „ „ „ „ „ „ „ „ „ „ „ „ „ „ „„„„„„ „ „ „ „ „ „ „ „ „ „ „ „ „ „ „ „ „„„„ „ „ „ „ „ „ „ „„„„ „ „ „ „ „ „ „„1¦À?ÀÌÌÌÌÀ»»ËÀ ÌÀ̼ËÌ Ì¼ËÌ Ì¼± À ÌÀÌ ÀÌ̼ËÀÌÌÀ ¼» À ÀÌ ÀÌÀÌ ÌÌÀÌ ÀÌ ÀÀÌÌÌÌÌ Ì, ÌÀ ÌÌÌ ÀÌ ÌÀÀÌ ÀÌÀÌÌÀÌÜÌ ÀÌ ÌÌÌÀÌÌÌÌ À ÌÌ À À ÌÀ ÌÌÌÀ ÜÝÍÌÀÌÀÌÌÌÀ Ì À À ÌÌ Ì »ÌÌÀÌÝÝÝ ÌÌ ÀÌÌÌÀÌÌÌÀÌ ÀÌ À ÀÌ»ÌÌÀÌîîî À ÌÌÀÌÌÀÌÀÝÝÝ ÌÌÌ """""""""""» """"""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""ÝÝÝÝ """""""""""""""""""""""""""""""""""""""""""""""ÝÝÝÝÝÝÝÝ""""""""""""""""""""""""""""""""""""""""""""""""""ÝÝÝÝîÝîÝîÝ""""""""""""""""""""""""""""""""""""""""""""""""""""îÝîÝîÝîÝîÝîÝ""""""""""""""""""""""""""""""""""""""""""""""""""""""îÝîÝîÝÝÝÝÝÝÝ""""""""""""""""""""""""""""""""""""""""""""""""""""""""ÝÝÝÝÝÝÝÝÝÝÝÝ""""""""""""""""""""""""""""""""""""""""""""""""""""""""""ÝÝÝÝÝÝîîîîîî""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""îîîîîîîîîîîî""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""îîîîîîÝÝÝÝÝÝ """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""ÝÝÝÝÑÝÝÝÝÝÝ """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""ÝÝÝÑîîÝÝÝÝÝÝî """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""îîÝÝÝÝîîÝÝÝÝÝÝî""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""îîÝÝÝÝ»îÝÝÝÝÝÝ""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""îÝÝÝ»áîÝÝÝÝÝÝ """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""îÝÝÝáî""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""î333îî""""""""""""""""""""""""""""""""""""""""",Ì,""""""""""""""""""""""""""""""""""""î333îî""""""î """"Ò"""""""""""""""""""""""""""23ìììÌ3333"""""""""""""""""""""""""""""""""333»îî""""""î"""""Ò"""""""""""""""""""""""233333ìîîÎ<3333333"""""""""""""""""""""""""""""3333îîÝÝÝÝÝÝî""""""Ò"-"""""""""""""""""""33333333ÌîîîÌ<33333333#"""""""""""""""""""""""""""ÝÝÝÝÝîîÝÝÝÝÝÝî """"""Ò"-"""""""""""""""""3333333333ÃìîîþÌÌ333333333#""""""""""""""""""""""""""ÝÝÝÝÝÝîîîîîîîîîîî"""""""Ò"-"""""""""""""""2333333333333ÌîîþïÎ<3333333333"""""""""""""""""""""""""îîîîîîîîîîîîîîîîîîî """"""ÒÝÝÝ-"""""""""""""33333333333333ÃìîþÌîÌ33333333333#""""""""""""""""""""""""îîîîîîîîîÝÝÝÝÝÝ"""""""ÝÝÝÝÝ"""""""""""23333333333333333ÌìþïîÎÌ333333333333"""""""""""""""""""""""ÝÝÝÝÝÝÝÝÝÝÝÝ"""""""ÒÝÝÝÝÝ-"""""""""2333333333333333333ÌþÌîÿÏ<333333333333"""""""""""""""""""""""ÝÝÝÝÝÝîîîîîî """""""ÒÝÝÝÝÝ-""""""""33333333333333333333ÃüïîþÿÌ3333333333333#""""""""""""""""""""""îîîîîîîîîîîî""""""""âîîîîî."""""""333333333333333333<ÌÌ3ÌÌîþÏÌ<3333333333333#"""""""""""""""""""""îîîîîîÝÝÝÝÝÝ """"""""ÒÝÝÝÝÝ-""""""3333333333333333333üÿÏ<ÃìîþÿÿÌ33333333333333#"""""""""""""""""""""ÝÝÝÝÝÝÝÝÝÝÝÝ"""""""""ÒÝÝÝÝÝ-"""""333333333333333<<33ÃÿªÿÌ3îîþÏüÏÌ33333333333333#""""""""""""""""""""ÝÝÝÝÝÝÝîÝîÝî """"""""""ÝÝÝÝÝ"""""3333333333333333ìÌ333¬šùÏ<ìîþÿÿÏ<333333333333333#""""""""""""""""""""ÝîÝîÝîÝîÝîÝî"""""""""""ÒÝÝÝ-""""33333333333333333ìÎ<33ÿ™ùÿÌîîþÏüÌ33333333333333333#"""""""""""""""""""ÝîÝîÝîÝÝÝÝ """""""""""""""""""233333333333333333ìîÌ33üŸùÿÿîîþÿÌ<333333333333333333""""""""""""""""""""ÝÝÝÝÝÝÝÝ"""""""""""""""""""2333333333333333333ìîÎÌ3ÌÿÿÿÿïïÿÏ<33333333333333333333"""""""""""""""""""ÝÝÝÝ """"""""""""""""""23333333333333333333ìîîÎ<Ãüÿÿÿÿÿÿÿ<333333333333333333333""""""""""""""""""" """"""""""""""""""33333333333333333333ìîîîÌ3Ìÿÿÿÿÿÿÿ<333333333333333333333#""""""""""""""""""""""""""""""""""""233333333333333333333ÌîîîÎ<ÃÌÿÿÿÏÿÿ<3333333333333333333333"""""""""""""""""" """""""""""""""""2333333333333333333333ÃÌþþþÌ3ìþÿÿÏÌÿ<33333333333333333333333""""""""""""""""""""""""""""""""""""33333333333333333333333ÃüÿÿÏììîÿÿÏÌü<33333333333333333333333#""""""""""""""""" """""""""""""""""2333333333333333333333333ÌÏÏÌîîþÿüÌ3<<333333333333333333333333"""""""""""""""""""""""""""""""""""23333333333333333333333333ÃÎÎîîîîÿÌ<3333333333333333333333333333""""""""""""""""""""""""""""""""""33333333333333333333333333ÃîîîîîþÿÿÌ3333333333333333333333333333#"""""""""""""""" """"""""""""""""233333333333333333333333333ÃìîþþþÿÿÿÏ<3333333333333333333333333333""""""""""""""""""""""""""""""""""3333333333333333333333333333ÌþÿÿOÿÿÿÿ43333333333333333333333333333#"""""""""""""""" """"""""""""""""233333333333333333333333333DDÄÌÿÿOÿÿÌÌLDD433333333333333333333333333""""""""""""""""" """"""""""""""""333333333333333333333333CDDDDDÄüüLÌLDDDDDDDD333333333333333333333333#""""""""""""""""""""""""""""""""233333333333333333333333DDDDDDDDÌüLÌLDDDDDDDDD433333333333333333333333"""""""""""""""" """"""""""""""""3333333333333333333333CDDDDDDDDDÄüOÏLDDDDDDDDDDD3333333333333333333333#""""""""""""""""""""""""""""""""2333333333333333333333DDDDDDDDDDDDÌOÌDDDDDDDDDDDDD4333333333333333333333""""""""""""""""""""""""""""""""333333333333333333333DDDDDDDDDDDDDÄÌDDDDDDDDDDDDDDD433333333333333333333#""""""""""""""" """""""""""""""233333333333333333333DDDDDDDDDDDDDDDÄDDDDDDDDDDDDDDDD433333333333333333333""""""""""""""""""""""""""""""""33333333333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD43333333333333333333#""""""""""""""""""""""""""""""23333333333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD43333333333333333333""""""""""""""" """""""""""""""3333333333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD4333333333333333333#""""""""""""""" """"""""""""""2333333333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD3333333333333333333""""""""""""""""""""""""""""""333333333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD333333333333333333#"""""""""""""" """""""""""""""333333333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD433333333333333333#""""""""""""""" """"""""""""""233333333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD433333333333333333""""""""""""""""""""""""""""""33333333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD33333333333333333#""""""""""""""""""""""""""""233333333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD433333333333333333"""""""""""""" """"""""""""""23333333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD43333333333333333""""""""""""""" """"""""""""""3333333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD3333333333333333#""""""""""""""""""""""""""""23333333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD43333333333333333""""""""""""""""""""""""""""3333333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD3333333333333333#""""""""""""" """"""""""""""3333333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD4333333333333333#"""""""""""""" """""""""""""2333333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD3333333333333333""""""""""""""""""""""""""""2333333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD4333333333333333""""""""""""""""""""""""""""333333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD333333333333333#""""""""""""" """""""""""""2333333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD4333333333333333"""""""""""""" """""""""""""233333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD333333333333333"""""""""""""" """""""""""""333333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD433333333333333#"""""""""""""""""""""""""""333333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD433333333333333#""""""""""""""""""""""""""233333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD333333333333333""""""""""""" """""""""""""233333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD433333333333333"""""""""""""" """""""""""""33333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD33333333333333#""""""""""!"" """""""""""""33333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD33333333333333#"""""""""""""""""""""""233333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD433333333333333""""""""""""""""""""""23333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD33333333333333"""""""±»""""""""""""""33333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD33333333333333#"""""""±" """""""""""""33333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD43333333333333#""""""""" """""""""""""3333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD3333333333333#"""""""±"" """"""""""""23333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD33333333333333"""""""±»"""""""""""""""23333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD43333333333333"""""""±"""""""""""""""33333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD43333333333333#""""""""""""""""""""""3333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD3333333333333#""""""""""""""""""""""""3333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD3333333333333#""""""""""""""""""""""""23333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD43333333333333""""""""""""""""""""""""23333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD43333333333333""""""""""""""""""""""""2333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD3333333333333""""""""""""""""""""""""3333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD3333333333333#"""""""""""""""""""""""3333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD4333333333333#"""""""""""""""""""""""3333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD4333333333333#""""""""""""""""""""""23333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD43333333333333""""""""""""""""""""""2333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD3333333333333""""""""""""""""""""""2333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD3333333333333""""""""""""""""""""""2333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD3333333333333""""""""""""""""""""""3333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD4333333333333#"""""""""""""""""""""3333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD4333333333333#"""""""""""""""""""""3333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD4333333333333#"""""""""""""""""""""333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD333333333333#"""""""""""""""""""""333333333333CDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD333333333333#""""""""""®2-- title: camtest -- author: commensalism -- desc: hi -- license: MIT License -- version: 0.1 -- script: lua local function ctz(a, b) if math.abs(a) <= math.abs(b) then return a else return b end end local function lerp(a, b, t) return a + ((b - a) * t) end local function sgn(a) if a > 0 then return 1 elseif a < 0 then return -1 else return 0 end end local plr = {x=math.random(-500, 500), y=math.random(-500, 500), a=math.pi / -2, xvel=0, yvel=0} local cam = {x=plr.x - 120, y=plr.y - 68} local rad = math.pi / 180 local slow = 0.01 local maxspeed = 1 local t = 0 local parts = {} local stars = {} local shots = {} local meteors = {} local stations = {} local shops = {{-100, -100, true}, {100, -100, true}, {0, 100, true}} local scd = 0 local mscd = 120 local mts = 0 local dmg = 1 local buys = {0, 0, 0} local boss = {act=false, maxhp=25, hp=25} local bt = 0 local tut = 0 for i = 1, 1000 do table.insert(stars, {math.random(-1000, 1000), math.random(-1000, 1000)}) end for i = 1, 5 do table.insert(stations, {math.random(0, math.pi // 0.5), math.random(0, 500)}) end for i = 1, 500 do table.insert(meteors, {math.random(-1000, 1000), math.random(-1000, 1000), math.random(0, 2)}) end function TIC() if btn(0) then plr.xvel = plr.xvel + math.cos(plr.a) * 0.05 plr.yvel = plr.yvel + math.sin(plr.a) * 0.05 table.insert(parts, {x=math.cos(plr.a + 135 * rad) * 15 + plr.x, y=math.sin(plr.a + 135 * rad) * 15 + plr.y, life=0, type=0, a=plr.a+math.pi}) table.insert(parts, {x=math.cos(plr.a + -135 * rad) * 15 + plr.x, y=math.sin(plr.a + -135 * rad) * 15 + plr.y, life=0, type=0, a=plr.a+math.pi}) end if btn(1) then plr.xvel = plr.xvel - math.cos(plr.a) * 0.05 plr.yvel = plr.yvel - math.sin(plr.a) * 0.05 table.insert(parts, {x=math.cos(plr.a + 45 * rad) * 15 + plr.x, y=math.sin(plr.a + 45 * rad) * 15 + plr.y, life=0, type=1, a=plr.a}) table.insert(parts, {x=math.cos(plr.a + -45 * rad) * 15 + plr.x, y=math.sin(plr.a + -45 * rad) * 15 + plr.y, life=0, type=1, a=plr.a}) end if btn(2) then plr.a = plr.a - rad * 2 end if btn(3) then plr.a = plr.a + rad * 2 end if btn(4) and scd <= 0 then table.insert(shots, {plr.x, plr.y, plr.a, 0}) scd = mscd sfx(1) end if btnp(5) and mts >= 3 then table.insert(stations, {math.atan(plr.y, plr.x), math.sqrt(plr.x^2 + plr.y^2)}) mts = mts - 3 end if scd > 0 then scd = scd - 1 end if #meteors < 50 then table.insert(meteors, {math.random(-500, 500), math.random(-500, 500), math.random(0, 2), math.random()}) end if bt % 3600 == 3599 then boss.act = true boss.hp = boss.maxhp end local attack = false if bt % 600 == 599 and boss.act then attack = true sfx(2) if #stations > 0 then table.remove(stations) else --game over end end --[[if plr.x - cam.x > 220 then cam.x = plr.x - 220 elseif plr.x - cam.x < 20 then cam.x = plr.x - 20 end if plr.y - cam.y > 116 then cam.y = plr.y - 116 elseif plr.y - cam.y < 20 then cam.y = plr.y - 20 end]] cam.x = lerp(cam.x, plr.x - 120, 0.05) cam.y = lerp(cam.y, plr.y - 68, 0.05) plr.x = plr.x + plr.xvel plr.y = plr.y + plr.yvel plr.xvel = math.max(math.min(maxspeed, plr.xvel), -maxspeed) plr.yvel = math.max(math.min(maxspeed, plr.yvel), -maxspeed) if plr.xvel > 0 then plr.xvel = plr.xvel - ctz(plr.xvel, slow) elseif plr.xvel < 0 then plr.xvel = plr.xvel + ctz(plr.xvel, slow) end if plr.yvel > 0 then plr.yvel = plr.yvel - ctz(plr.yvel, slow) elseif plr.yvel < 0 then plr.yvel = plr.yvel + ctz(plr.yvel, slow) end if attack then cls(12) else cls(0) end for _, s in ipairs(stars) do pix(s[1] - cam.x, s[2] - cam.y, 12) end --circ(plr.x - cam.x, plr.y - cam.y, 10, 5) circ(0 - cam.x, 0 - cam.y, 125, 2) circ(0 - cam.x, 0 - cam.y, 100, 3) circ(0 - cam.x, 0 - cam.y, 75, 4) if shops[1][3] then spr(82, shops[1][1] - 16 - cam.x, shops[1][2] - 16 - cam.y, 0, 2, 0, 0, 2, 2) end if shops[2][3] then spr(84, shops[2][1] - 16 - cam.x, shops[2][2] - 16 - cam.y, 0, 2, 0, 0, 2, 2) end if shops[2][3] then spr(86, shops[3][1] - 16 - cam.x, shops[3][2] - 16 - cam.y, 0, 2, 0, 0, 2, 2) end for i, p in ipairs(parts) do if p.life >= 60 then table.remove(parts, i) goto cont end local color if p.type == 0 then color = 4 if p.life > 45 then color = 13 elseif p.life > 30 then color = 2 elseif p.life > 15 then color = 3 end elseif p.type == 1 then color = 10 if p.life > 40 then color = 8 elseif p.life > 20 then color = 9 end elseif p.type == 2 then color = 1 elseif p.type == 3 then color = 14 elseif p.type == 4 then color = 14 end if p.type <= 1 then circ(p.x - cam.x, p.y - cam.y, (60 - p.life) / 12, color) local r = math.random(-45, 45) p.x = p.x + math.cos(p.a + r * rad) p.y = p.y + math.sin(p.a + r * rad) elseif p.type == 4 then circ(p.x - cam.x, p.y - cam.y, (60 - p.life) / 10, color) p.x = p.x + math.cos(p.a * rad) * math.random() * 10 p.y = p.y + math.sin(p.a * rad) * math.random() * 10 else circ(p.x - cam.x, p.y - cam.y, (60 - p.life) / 30, color) p.x = p.x + math.cos(p.a * rad) * math.random() p.y = p.y + math.sin(p.a * rad) * math.random() end p.life = p.life + 1 ::cont:: end if btn(6) then line(plr.x - cam.x, plr.y - cam.y, math.cos(plr.a) * 275 + plr.x - cam.x, math.sin(plr.a) * 275 + plr.y - cam.y, 7) end for i, s in ipairs(shots) do if s[4] > 60 then table.remove(shots, i) goto cont end local dx = math.cos(s[3]) local dy = math.sin(s[3]) s[1] = s[1] + dx * 5 s[2] = s[2] + dy * 5 line(s[1] - dx * 5 - cam.x, s[2] - dy * 5 - cam.y, s[1] + dx * 5 - cam.x, s[2] + dy * 5 - cam.y, 2) s[4] = s[4] + 1 for j, m in ipairs(meteors) do local distsq = (s[1] - m[1])^2 + (s[2] - m[2])^2 if distsq <= 64 then mts = mts + dmg table.remove(meteors, j) table.remove(shots, i) for k = 1, 50 do table.insert(parts, {x=m[1], y=m[2], life=0, type=2, a=math.random(0, 360)}) end end end if boss.act then local distsq = (s[1] - 0)^2 + (s[2] - -200)^2 if distsq <= 256 then boss.hp = boss.hp - dmg table.remove(shots, i) if boss.hp <= 0 then boss.act = false boss.hp = boss.maxhp sfx(3) for k = 1, 100 do table.insert(parts, {x=0, y=-200, life=0, type=4, a=math.random(0, 360)}) end end end end ::cont:: end for _, m in ipairs(meteors) do if m[3] == 0 then ttri(math.cos(t / 50 + -45 * rad) * 8 + (m[1] - cam.x), math.sin(t / 50 + -45 * rad) * 8 + (m[2] - cam.y), math.cos(t / 50 + 45 * rad) * 8 + (m[1] - cam.x), math.sin(t / 50 + 45 * rad) * 8 + (m[2] - cam.y), math.cos(t / 50 + 135 * rad) * 8 + (m[1] - cam.x), math.sin(t / 50 + 135 * rad) * 8 + (m[2] - cam.y), 32, 0, 48, 0, 48, 16, 0, 0) ttri(math.cos(t / 50 + 135 * rad) * 8 + (m[1] - cam.x), math.sin(t / 50 + 135 * rad) * 8 + (m[2] - cam.y), math.cos(t / 50 + -135 * rad) * 8 + (m[1] - cam.x), math.sin(t / 50 + -135 * rad) * 8 + (m[2] - cam.y), math.cos(t / 50 + -45 * rad) * 8 + (m[1] - cam.x), math.sin(t / 50 + -45 * rad) * 8 + (m[2] - cam.y), 48, 16, 32, 16, 32, 0, 0, 0) else ttri(math.cos(t / 50 + -45 * rad) * 8 + (m[1] - cam.x), math.sin(t / 50 + -45 * rad) * 8 + (m[2] - cam.y), math.cos(t / 50 + 45 * rad) * 8 + (m[1] - cam.x), math.sin(t / 50 + 45 * rad) * 8 + (m[2] - cam.y), math.cos(t / 50 + 135 * rad) * 8 + (m[1] - cam.x), math.sin(t / 50 + 135 * rad) * 8 + (m[2] - cam.y), 48, 0, 64, 0, 64, 16, 0, 0) ttri(math.cos(t / 50 + 135 * rad) * 8 + (m[1] - cam.x), math.sin(t / 50 + 135 * rad) * 8 + (m[2] - cam.y), math.cos(t / 50 + -135 * rad) * 8 + (m[1] - cam.x), math.sin(t / 50 + -135 * rad) * 8 + (m[2] - cam.y), math.cos(t / 50 + -45 * rad) * 8 + (m[1] - cam.x), math.sin(t / 50 + -45 * rad) * 8 + (m[2] - cam.y), 64, 16, 48, 16, 48, 0, 0, 0) end end for i, s in ipairs(stations) do spr(80, math.cos(s[1]) * s[2] - cam.x, math.sin(s[1]) * s[2] - cam.y, 0, 1, 0, 0, 2, 2) s[1] = s[1] + rad / 10 end rectb(-1000 - cam.x, -1000 - cam.y, 2000, 2000, 8) if boss.act then spr(112, -32 - cam.x, -232 - cam.y, 0, 1, 0, 0, 8, 8) rect(-32 - cam.x, -158 - cam.y, (boss.hp / boss.maxhp) * 64, 5, 6) end --line(plr.x - cam.x, plr.y - cam.y, math.cos(plr.a) * 20 + (plr.x - cam.x), math.sin(plr.a) * 20 + (plr.y - cam.y), 4) ttri(math.cos(plr.a + -45 * rad) * 20 + (plr.x - cam.x), math.sin(plr.a + -45 * rad) * 20 + (plr.y - cam.y), math.cos(plr.a + 45 * rad) * 20 + (plr.x - cam.x), math.sin(plr.a + 45 * rad) * 20 + (plr.y - cam.y), math.cos(plr.a + 135 * rad) * 20 + (plr.x - cam.x), math.sin(plr.a + 135 * rad) * 20 + (plr.y - cam.y), 8, 0, 28, 0, 28, 22, 0, 0) ttri(math.cos(plr.a + 135 * rad) * 20 + (plr.x - cam.x), math.sin(plr.a + 135 * rad) * 20 + (plr.y - cam.y), math.cos(plr.a + -135 * rad) * 20 + (plr.x - cam.x), math.sin(plr.a + -135 * rad) * 20 + (plr.y - cam.y), math.cos(plr.a + -45 * rad) * 20 + (plr.x - cam.x), math.sin(plr.a + -45 * rad) * 20 + (plr.y - cam.y), 28, 22, 8, 22, 8, 0, 0, 0) if (plr.x - shops[1][1])^2 + (plr.y - shops[1][2])^2 <= 1024 and shops[1][3] then circb(shops[1][1] - cam.x, shops[1][2] - cam.y, 32, 6) if btnp(7) and mts >= buys[1] * 5 + 5 then dmg = dmg + 1 mts = mts - (buys[1] * 5 + 5) buys[1] = buys[1] + 1 sfx(0) if buys[1] >= 4 then shops[1][3] = false for k = 1, 50 do table.insert(parts, {x=shops[1][1], y=shops[1][2], life=0, type=3, a=math.random(0, 360)}) end end end elseif (plr.x - shops[2][1])^2 + (plr.y - shops[2][2])^2 <= 1024 and shops[2][3] then circb(shops[2][1] - cam.x, shops[2][2] - cam.y, 32, 6) if btnp(7) and mts >= 5 then mscd = mscd - 30 mts = mts - 5 buys[2] = buys[2] + 1 sfx(0) if buys[2] >= 3 then shops[2][3] = false for k = 1, 50 do table.insert(parts, {x=shops[2][1], y=shops[2][2], life=0, type=3, a=math.random(0, 360)}) end end end elseif (plr.x - shops[3][1])^2 + (plr.y - shops[3][2])^2 <= 1024 and shops[3][3] then circb(shops[3][1] - cam.x, shops[3][2] - cam.y, 32, 15) end local cstr local cstrw if shops[1][3] then cstrw = print("Damage", 0, -8) print("Damage", shops[1][1] - cstrw / 2 - cam.x, shops[1][2] - 32 - cam.y, 12) cstrw = print(buys[1] * 5 + 5, 0, -8) print(buys[1] * 5 + 5, shops[1][1] - cstrw / 2 - cam.x, shops[1][2] - 38 - cam.y, 12) end if shops[2][3] then cstrw = print("Firerate", 0, -8) print("Firerate", shops[2][1] - cstrw / 2 - cam.x, shops[2][2] - 32 - cam.y, 12) cstrw = print("5", 0, -8) print("5", shops[2][1] - cstrw / 2 - cam.x, shops[2][2] - 38 - cam.y, 12) end if shops[3][3] then cstrw = print("XXXXXX", 0, -8) print("XXXXXX", shops[3][1] - cstrw / 2 - cam.x, shops[3][2] - 32 - cam.y, 12) end local pl = -math.sqrt(plr.x^2 + plr.y^2) local pn = {plr.x / pl, plr.y / pl} line(plr.x + pn[1] * 10 - cam.x, plr.y + pn[2] * 10 - cam.y, plr.x + pn[1] * 20 - cam.x, plr.y + pn[2] * 20 - cam.y, 4) if mscd > 30 then rect(plr.x - 25 - cam.x, plr.y + 30 - cam.y, 50 * (scd / mscd), 2, 2) end cstr = "x" .. mts cstrw = print(cstr, 0, -8) print(cstr, 230 - cstrw, 10, 12) spr(48, 221 - cstrw, 10, 0) cstr = "x" .. #stations cstrw = print(cstr, 0, -8) print(cstr, 230 - cstrw, 20, 12) spr(49, 221 - cstrw, 20, 0) if tut == 0 then cstrw = print("Shoot meteors to gain resources", 0, -8) print("Shoot meteors to gain resources", plr.x - cstrw / 2 - cam.x, plr.y - 32 - cam.y, 12) if mts > 0 then tut = 1 end elseif tut == 1 then cstrw = print("Buy upgrades at the sun for resources", 0, -8) print("Buy upgrades at the sun for resources", plr.x - cstrw / 2 - cam.x, plr.y - 32 - cam.y, 12) cstrw = print("Fly up to a shop and press S/Y", 0, -8) print("Fly up to a shop and press S/Y", plr.x - cstrw / 2 - cam.x, plr.y + 32 - cam.y, 12) cstrw = print("(Yellow line shows direction to the sun)", 0, -8) print("(Yellow line shows direction to the sun)", plr.x - cstrw / 2 - cam.x, plr.y + 42 - cam.y, 12) if buys[1] > 0 or buys[2] > 0 or buys[3] > 0 then tut = 2 end elseif tut == 2 then cstrw = print("Stations act as health points", 0, -8) print("Stations act as health points", plr.x - cstrw / 2 - cam.x, plr.y - 32 - cam.y, 12) cstrw = print("If you run out of stations, the game ends", 0, -8) print("If you run out of stations, the game ends", plr.x - cstrw / 2 - cam.x, plr.y + 32 - cam.y, 12) cstrw = print("Press X/B to build one for 3 resources", 0, -8) print("Press X/B to build one for 3 resources", plr.x - cstrw / 2 - cam.x, plr.y + 42 - cam.y, 12) if #stations > 5 then tut = 3 end elseif tut == 3 then cstrw = print("The boss will spawn soon", 0, -8) print("The boss will spawn soon", plr.x - cstrw / 2 - cam.x, plr.y - 32 - cam.y, 12) cstrw = print("Buy more upgrades and stations", 0, -8) print("Buy more upgrades and stations", plr.x - cstrw / 2 - cam.x, plr.y + 32 - cam.y, 12) if btn(4) then tut = 4 end end t = t + 1 if tut > 3 then bt = bt + 1 end end