0,]']±>Sï}WÿÍu§ðp8·d%qy)6o;]ÉA¦ösï÷ôôô”°ÂVl†ÿ²î P!BuËíÿÿîÍ›%¨d@@BýhDDDDD†"dvVev¹ýŸÖ«efVE3¨d@@Bý¨D„D„D†Á,ÌÌ ,ÌÌ"ÌÌ,"ÌÌÂ"ÌÌÌ"ÂÌÂ@ÄLÄL@ÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝ""""""Ì,",Ì,",Ì,ÂÌ,,ÂÌ""ÂÌ,,""""pwpwwwwwwwwwpwwpwwwwwwPUPUUUUUUUUUPUUPUUUUUU  """""""" "" """""" @@DDDDDDDD@DD@DDDDDD@,Ì "Ì " " " """""ÌÌ"ÌÌ"Â"""""""ÌÌÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÐÐÝÝÝÝÝÝÝÝÝ ÝÝÝÝÝÝÝÝÝÝÐÝ ÐÝÝÝÝÝ ÝÐÝÝÝÝÝÝÐÝÝÝÝÐÝÝÝÝÝÝÐÝÝÝÝÝ ÝÝÝÝÝ ÝÝÝ Ý ”                    €‘³ÄÕç ,>_oc p  #$%%&&&&&&&&&&&&&&&&&&&&&&&&&  ���  �93101222233333333 3 333ð3à3à3ð333334Ÿ93 1@0 1à2À3à34445566666777777777778p@AðABBBBBBBBBBBBBBBBBBBBBBBBBBB D,ɢƢ͂ɢƢ͂ɢƢ͂ɢƢ͂ȢȢȢɢƢ͂ɢƢ͂ɢƢ͂ɢƢ͂ˢˢˢɢ¤¢¤¢¤¢¨¢¨¢¨¢«‚«‚Ë‚®‚®‚΂Ƣ͂ɢƢ͂ɢƢ͂ɢƢ͂ȢȢȢɢƢ͂ɢƢ͂ɢƢ͂ɢƢ͂ˢˢˢɢƢ͂ɢƢ͂ɢƢ͂ɢƢ͂ȢȢȢɢƢ͂ɢƢ¤¢¤¢¤¢¨¢¨¢¨¢¤¢¤¢¤¢«‚«‚Ë‚®‚®‚΂«‚«‚˂͂ɢƢ͂ɢƢ͂ˢˢˢɢƢ͂ɢƢ͂ɢƢ͂ɢƢ͂ȢȢȢɢƢ͂ɢƢ͂ɢƢ͂ɢƢ͂ˢˢˢ¨¢¨¢¨¢¤¢¤¢¤¢¨¢¨¢¨¢®‚®‚΂«‚«‚Ë‚®‚®‚΂ý‚ù‚ü‚ýbùbübø‚ÿ‚ü‚û‚þ‚ý‚ù‚ü‚ø‚ÿ¢ü¢û¢ö¢ý¢ø¢øbÿbübûbþbýbùbübøbÿ‚ü‚û‚ý‚ù¢ý‚ý¢ù¢û¢ý¢û¢ÿ¢öÂý¢øÂùÂøÂùÂøÂöÂôÂý¢ôÂû¢ý¢ù¢ö¢ý¢ø¢ù¢ö¢ø¢ù¢ø¢û¢ý¢ù¢ôÂöÂôÂöÂôÂù¢ù¢ù¢ý¢ø¢ù¢ö¢ý‚ù¢ý‚ý¢ù¢û¢ý¢û¢ÿ¢öÂý¢øÂùÂøÂùÂøÂöÂôÂöÂö¢ý¢ø¢ù¢ö¢ø¢ù¢ø¢û¢ý¢ù¢ôÂöÂôÂöÂôÂù¢ù¢ý¢ý‚ù¢ý‚ý¢ù¢û¢ý¢û¢ÿ¢öÂý¢øÂùÂøÂùÂøÂöÂôÂý¢ôÂû¢ý¢ù¢ö¢ý¢ø¢ù¢ö¢ø¢ù¢ø¢û¢ý¢ù¢ôÂöÂôÂöÂôÂù¢ù¢ù¢ý¢ø¢ù¢ö¢ý‚ù¢ý‚ý¢ù¢û¢ý¢û¢ÿ¢öÂý¢øÂùÂøÂùÂøÂöÂôÂöÂù¢ö¢ø¢ù¢ø¢û¢ý¢ù¢ôÂöÂôÂöÂôÂù¢ù¢ý¢1�0Da’ÊLÎPÒTÀ?™ ©ª �ªš©ª �ªš©ª �ÊÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ ÉÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ �ªš™ �™�ªš™™ªš©ª ™3�ªšªš©ª �™0D43“ªšªš©ª ©ª 0D40D4ªš™ �™©ª �™0D430D4™ ©ª ©ª DDDADD3CD3C4�™©ª DADDDDAACD30D4©ª DDDDADDC4D40D4�™DDDADAA03D4ÝÝ03D4DDADADAD0D43ÝÝCD33CDÝÝCDCD33ÝÝ03DCDCDÝÝCD303CDÝÝCDCD3ÝÝ3CDAAAA!!!!!!!!03D4ÝÝ0D43DDDDDDDD""""""""""""""""™0D4ÝÝ0D4�™DDDDDDDD""""""""""""""""ª 0D3ÓÝ0D4©ª ADDADD!""!""!""!""ª 3D4Ý033©ª ADDADD!""!""!""!""ª 0D4ÝCD©ª DDDD""""""""™0D4Ý3CD�™DDDD""""""""333D4DAA!!!!043D433CDC4033CD3QqqCDCCD3UQUwqwwqwCD3334�™UUUUwwwwwwww3CD=D4©ª UUUUwwwwwwww0D43Ý33©ª QUUqwwqww�™0D4Ý=D4©ª QUUqwwqww©ª 3D4Ý=D4Ý �™UUwwww©ª 0D3Ó Ý=D43 UUwwww©ª 0D4ÝÝÝÝ3CD™�™™ 0D4ÝÝ ÝÝÐCD3�ª�ªš033ÐÝÝÝÝÝCDC4�ª�ªšCDÝÝÝÝÝ=3D43�ª�ªšCDÐÝÝÝÝ 0D4D™™ 0CDÝÝÝÝ3CD™ C43ÐÝÝ CD33�ªšCDÝÝ03CD�ªš3CDCD�ªš0D43CD3™ 03D403D4™ C4D40D4�ªš™ �™CD30D4 �ªš�ªš©ªCD3£š�ªš�ªš©ª93�ªš™ �ªš©ª �ªš™™ �™™™�ª©ª �ª©ª �ª©ª ™�™�™©ª ©ª ©ª �™�™©ª ©ª ©ª �™™ �ªš�ªš�ªš™ ™ �ªš™ �ªš�ªš�ªš™ �ªš™ �ªš�ªš�ªš™ ™ �ªš�ªš™ �ªš �ªš �™™  ™ ©ª �ªš©ª �ªš©ª �ªš�™™ ™ �ªš�ªš�ªš™ ™ �ªš,Ì™ �ªšÌÌ ÌÂ�ªš�ªš,ÌÌ""ÌÌÌ�ªš™ ÌÌ,""ÂÌÂ�ªš,Ì ""ÌÌ™ Ì "" "" "" """"""""""™ ÌÌÌÌ�ªš�ªš�™�ªš©ª ™ ™ ™©ª �ªš�ª©ª �ªš�ªš™�ªš�ªš™ ™ ™ �ªš�ªš�ªš™ «-- title: tichou -- author: commensalism -- desc: touhou tic recreation -- license: MIT License -- version: 0.1 -- script: lua local t = 0 local lt = 0 local scr = {w=116, h=136} scr.cx, scr.cy = scr.w/2, scr.h/2 local shots = {} local rad = math.pi/180 local plr = {x=scr.cx, y=scr.h-30, i=0, hp=5, bomb=3, 3} local hits = 0 local boss = {x=scr.cx, y=30, hp=500, maxhp=500, sc=1} local pshots = {} local function trf(a) return 2*math.abs(2 * ((a/45) - math.floor((a/45) + 0.5))) - 1 end local function shotA(x, y, a, s, sz, col, colb) local shot = {type="a", x=x, y=y, a=a, s=s, sz=sz, col=col, colb=colb, life=0} table.insert(shots, shot) return shot end local function shotB(x, y, xvel, yvel, sz, col, colb) local shot = {type="b", x=x, y=y, xvel=xvel, yvel=yvel, sz=sz, col=col, colb=colb, life=0} table.insert(shots, shot) return shot end local function pshotA(x, y, s) table.insert(pshots, {x=x, y=y, s=s, type="a", life=0}) end local function update_shots() for i, s in ipairs(shots) do if s.x < -20 or s.y < -20 or s.x > scr.w + 20 or s.y > scr.h + 20 then table.remove(shots, i) goto cont end if string.lower(s.type) == "a" then local dx = math.cos(s.a)*s.s local dy = math.sin(s.a)*s.s s.x = s.x + dx s.y = s.y + dy elseif string.lower(s.type) == "b" then s.x = s.x + s.xvel s.y = s.y + s.yvel end s.life = s.life + 1 ::cont:: end for i, s in ipairs(pshots) do if s.x < -20 or s.y < -20 or s.x > scr.w + 20 or s.y > scr.h + 20 then table.remove(pshots, i) goto cont end if s.type == string.lower("a") then s.y = s.y - s.s end s.life = s.life + 1 ::cont:: end end local function draw_shots() for i, s in ipairs(shots) do circ(s.x, s.y, s.sz, s.col) if s.colb ~= -1 then circb(s.x, s.y, s.sz, s.colb) end end for i, s in ipairs(pshots) do spr(7, s.x - 4, s.y - 4, 0) end end local function hit() plr.hp = plr.hp - 1 plr.bomb = 1 plr.i = 60 hits = hits + 1 plr.x = scr.cx plr.y = scr.h - 30 sfx(0, "C-4") end local function shot_coll() for i, s in ipairs(pshots) do if (s.x - boss.x)^2 + (s.y - boss.y)^2 <= 256 then boss.hp = boss.hp - 1 table.remove(pshots, i) end end if plr.i > 0 then return end for i, s in ipairs(shots) do if (s.x - plr.x)^2 + (s.y - plr.y)^2 <= s.sz^2 then hit() return end end end poke(0x3FF8, 1) local ang = 0 local axel = 0 local ln = 0 local lx = 0 local ly = 0 local gg = false --music(0) function TIC() if boss.hp <= 9 and boss.sc >= 5 then cls(12) poke(0x3FF8, 12) print("win", 121, 69, 13) print("win", 120, 68, 0) return elseif plr.hp < 0 then cls(12) poke(0x3FF8, 12) print("lose", 121, 69, 13) print("lose", 120, 68, 0) return end if boss.hp <= 0 and boss.sc < 5 then boss.sc = boss.sc + 1 shots = {} lt = 0 plr.hp = math.min(5, plr.hp + 1) plr.bomb = 3 boss.hp = boss.maxhp sfx(2, "C-4") end local foc = btn(6) or key(64) local spd = 1.5 local bombed = false if foc then spd = 1 end if btn(0) then plr.y = plr.y - spd end if btn(1) then plr.y = plr.y + spd end if btn(2) then plr.x = plr.x - spd end if btn(3) then plr.x = plr.x + spd end if btn(4) then pshotA(plr.x, plr.y, 20) if t % 10 == 0 then sfx(3, "B-8", 2, 1) end end if btnp(5) and plr.bomb > 0 then shots = {} boss.hp = boss.hp - 50 plr.bomb = plr.bomb - 1 sfx(1, "C-4") bombed = true end plr.x = math.min(math.max(plr.x, 0), scr.w) plr.y = math.min(math.max(plr.y, 0), scr.h) if plr.i > 0 then plr.i = plr.i - 1 end cls(0) if bombed then cls(12) end update_shots() shot_coll() spr(3, boss.x - 16, boss.y - 16, 0, 1, 0, 0, 4, 4) if plr.i > 0 then if t % 2 == 0 then spr(0, plr.x - 8, plr.y - 8, 0, 1, 0, 0, 2, 2) end else spr(0, plr.x - 8, plr.y - 8, 0, 1, 0, 0, 2, 2) end if foc then spr(2, plr.x-2, plr.y - 2, 0) circb(plr.x, plr.y, 10, 4) line(math.cos(t*rad)*15+plr.x, math.sin(t*rad)*15+plr.y, math.cos(t*rad)*25+plr.x, math.sin(t*rad)*25+plr.y, 4) line(math.cos((t+90)*rad)*15+plr.x, math.sin((t+90)*rad)*15+plr.y, math.cos((t+90)*rad)*25+plr.x, math.sin((t+90)*rad)*25+plr.y, 4) line(math.cos((t+180)*rad)*15+plr.x, math.sin((t+180)*rad)*15+plr.y, math.cos((t+180)*rad)*25+plr.x, math.sin((t+180)*rad)*25+plr.y, 4) line(math.cos((t-90)*rad)*15+plr.x, math.sin((t-90)*rad)*15+plr.y, math.cos((t-90)*rad)*25+plr.x, math.sin((t-90)*rad)*25+plr.y, 4) end if boss.sc == 1 then if t % 30 == 0 then local of = math.random()*360 for i = 0, 15 do shotA(boss.x, boss.y, (i*(360/16)+of)*rad, 1, 5, 10, 9) end end elseif boss.sc == 2 then if t % 30 == 0 then ln = math.random(45, 135) * rad end local shot = shotA(boss.x, boss.y, ln, 1, 3, 10, -1) shot.ba = ln for i, s in ipairs(shots) do --s.a = s.ba + math.sin(s.life * rad) * rad s.a = s.ba + trf(s.life) * rad * 50 end elseif boss.sc == 3 then if lt % 300 == 0 then shotB(boss.x, boss.y + 20, 0, 0, 15, 3, 2) end for i, s in ipairs(shots) do local len = math.sqrt((plr.x - s.x)^2 + (plr.y - s.y)^2) s.xvel = (plr.x - s.x)/len/5 s.yvel = (plr.y - s.y)/len/5 if s.life > 360 then for i = 0, 15 do shotA(s.x, s.y, (i*(360/16)+math.random()*360)*rad, 1, 5, 2, 1) end table.remove(shots, i) end end elseif boss.sc == 4 then for i, s in ipairs(shots) do if s.life > 180 then table.remove(shots, i) elseif s.life > 30 and lt > 300 then s.a = s.a + s.rand*rad if s.col == 4 then s.col = 10 s.colb = 9 end end end local shot if lt > 300 then shot = shotA(scr.cx, 30, ang*rad, 1, 2, 4, 3) else shot = shotA(scr.cx, 30, ang*rad, 1, 2, 5, 6) end shot.rand = math.random()*2-1 ang = ang + axel axel = axel + 0.1 elseif boss.sc == 5 then if lt % 300 == 0 then local len = math.sqrt((plr.x - boss.x)^2 + (plr.y - boss.y)^2) lx = (plr.x - boss.x)/len ly = (plr.y - boss.y)/len elseif lt % 300 == 120 then sfx(3, "B-8", 180, 2) elseif lt % 300 > 120 then shotB(boss.x, boss.y, lx*3, ly*3, 10, 15, -1) else line(boss.x, boss.y, boss.x + lx * 300, boss.y + ly * 300, 2) end if lt % 60 == 0 then for i = 0, 15 do shotA(boss.x, boss.y, (i*(360/16)+math.random()*360)*rad, 1, 5, 15, 2) end end for i, s in ipairs(shots) do if s.colb == -1 then s.sz = s.sz + 0.5 end end end draw_shots() rect(3, 3, boss.hp / boss.maxhp * (scr.w - 6), 2, 12) rect(scr.w, 0, 240 - scr.w, scr.h, 1) print("Hits: " .. hits, scr.w + 10, 10, 4) for i = 0, 5 do if plr.hp >= i then spr(11, scr.w + 10 + (i * 10), 20, 0) else spr(10, scr.w + 10 + (i * 10), 20, 0) end end for i = 1, 3 do if plr.bomb >= i then spr(9, scr.w + 10 + ((i - 1) * 10), 30, 0) else spr(8, scr.w + 10 + ((i - 1) * 10), 30, 0) end end lt = lt + 1 t = t + 1 end