0]']ÿï}WÿÍu®• ÿmUi•)6o;]ÉA¦ösï÷ÿÿÿ”°ÂVl†380 then if math.random(0,20) > 2 then enemy(v.x,v.y,'thun',8,33) table.remove(obj,i) else for i = 0,1 do enemy(v.x+(i*8),v.y,'fly',4,50) end table.remove(obj,i) end end end if v.id == 'bull' then if v.x > 300 or v.x < 0 then table.remove(obj,i) end for I,V in pairs(obj) do if V.id == 'enem' then if collision(v.x,v.y,V.x,V.y,3,V.size) then table.remove(obj,I) end end end end if v.id == 'enem' then if v.t == 'thun' then if collision(p.x,p.y,v.x,v.y,8,8) == true then TIMER = 0 POL = 0 end v.vx, v.vy = vector(v.x,p.x,v.y,p.y,2) end if v.t == 'fly' then if collision(p.x,p.y,v.x,v.y,3,8) == true then TIMER = 0 POL = 0 end v.vx = math.random(-10,10)/10 v.vy = math.random(-10,10)/10 end end end end function shoot(x,y,vx) bul = { id = 'bull', x = x, y = y, vx = vx, vy = 0 } table.insert(obj,bul) end function pobeda() sfx(-1) cls(6) print('thanks for playing',0,0,0) TIMER = TIMER + 1 if TIMER > 500 then POL = 0 TIMER = 0 end end function main() TIMER = TIMER + 1 if TIMER//60 == 20 then POL = 2 TIMER = 0 end draw() if p.x<0 then p.x =239 end if p.x>239 then p.x = 0 end if p.y+p.vy>121 then p.tor = 0 p.vy = 0 p.vx = 0 end if p.y+p.vy<0 then p.tor = 0 p.vy = 0 p.vx = 0 end if btnp(4) and p.P == 1 then sfx(0,30,-1,1) shoot(p.x,p.y,-1) p.vx = p.vx + 0.5 end if btnp(4) and p.P == 0 then p.vx = p.vx - 0.5 shoot(p.x,p.y,1) sfx(0,30,-1,1) end if p.vx < -7 then p.vx = -7 end if p.vx > 7 then p.vx = 7 end if btn(0) then p.tor = p.tor - 0.1 sfx(1,-1,-1,0) if time()%100>80 then part(p.x,p.y+8) end else sfx(-1,nil,nil,0) p.tor = p.tor + 0.01 end if btnp(2) then p.P=1 end if btnp(3) then p.P=0 end if p.tor < -0.015 then p.tor = -0.015 end if p.tor > 0.01 then p.tor = 0.01 end wawegen() update() end function draw() map() for i,v in pairs(obj) do if v.id == 'part' then circ(v.x,v.y,v.l/6,4) end if v.id == 'bull' then spr(49,v.x,v.y,0) end if v.id == 'tar' then circb(v.x,v.y,v.t/10,2) end if v.id == 'enem' then if v.t == 'thun' then v.img = v.img + 0.1 if v.img > 40 then v.img = 33 end spr(v.img,v.x,v.y,0) end if v.t == 'fly' then v.img = v.img + 0.1 if v.img > 52 then v.img = 50 end spr(v.img,v.x,v.y,0) end end end spr(1,p.x,p.y,0,1,p.P) print(TIMER//60) end VT = 0 function part(x,y) par = { id = 'part', x = x, y = y, vx = 0, vy = 1, l = 20 } table.insert(obj,par) end function start() sfx(-1) cls() print('20 seconds',82,5,12) print('on the moon',80,12,12) print('press start (z)',86,80,12) print('up - fly',4,64) print('z - shot',4,72) TIMER = TIMER + VT if btnp(4) then VT = 1 end if TIMER > 30 then POL = 1 VT = 0 init() end end function enemy(x,y,type,size,img) en = { id = 'enem', t = type, x = x, y = y, vy=0, vx=0, size = size, img = img } table.insert(obj,en) end vbank(0) -- set the border color to palette index 10 poke(0x03FF8, 14) function TIC() if POL == 2 then pobeda() end if POL == 0 then start() end if POL == 1 then main() end end