0,]']>S}Wup8d%qy)6o;]AsVl3IJIJLMN9:IJ!56!34EFCD         00000000000000112334566789:;=?PP  ```````````o   !ACFAECB@CEDCCEBD@DBCECADNO@@@@@A@AABBCCDDEEFFGGHIIJKKLMO!ABCD&EwF7GGHII J.KKKKKJ/J?I>IH GGFEDCBO"` `` `````` ` ` ` ` `````g```g```gg``g```g`g                 "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb b b b b bbbfffffffffffffffffffffffffffffffffff           ```````````````````` ```````````````@`@`@`@`@````` ```` `````` ````````` ```````` ````````` ````````` ````````` ```` `\\\\\\z\j\Z\J\*\\\\\\\\v\f\\\\\\\x\h\\\\\\\z\j\Z\J\*\\\\\\\\v\f\\\\\\\z\j\@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@````````````````````$$4``t`d`T`D`4`$``1111$1111111411411111411$1t1141t11141411d14111d1414141t1111411$141t1$11141141t11114141t1$111$1UaUU\T\TUrZry|t~t~y|t~t~y|t~x}t}u|x}t}u|x}|~{}w}x|{}w}x|{}~~}~}~~tXaWa\a]aXsXr\t]St~XsXr\t]St~{]^{]Xs^{]Xs^{]Xs\tWWWWWWWWwWWwWWwWwWWwWWwWwWWwWWwWwWWwWWwW\a[aXaZa89:;89:;89:;89:989:;89:;89:;89:;89:;89:;89:;89:;  HtN ΁΁4;ﻼ˻ ߾˻˻˻뿼뿼޿޿  ߾˻˻˻ ˻ ݾ˻  ܽ ˻ﻼ˻ ˻˻ݾﻼ ˻힙˻߈˻˻߈߈  ޏ ވ ﻈ  ˈ  𽈘      (  ψ Ͽ Ͽ   (    )          ˻˻˻˻˻ ˻ ߿    #2 0߾˻ ˻뿼޿ #2#200߾ ﻻ  -- title: Tilaxian -- author: OdiStudio Games, odistudio4444@gmail.com -- desc: a shoot em up -- site: website link -- license: All rigth reserd(c) -- version: 1.10.1 -- script: lua -- valu rnd,sin,cos=math.random,math.sin,math.cos -- intensity sfx volume=5 volumeM=7 -- language language=0 text="" text1={ t1="Choisit une langue"; t2="Jouer"; t3="Option"; t4="A propos"; t5="Sortir"; t6="Faire un don"; t7="Niveau"; t8="Niveau bonus"; t9="Mode de jeu"; t10="Facile"; t11="Norlmale"; t12="Difficile"; t13="HardCore!"; t14="Cette fois ci c'est"; t15="moi ton adversaire!"; t16="C'est pas vrai"; t17="Je ne peut pas perdre!"; t18="Je reviendrai!"; t19="Encore toi!"; t20="Cette fois ci ce ne sera"; t21="pas aussi facile!"; t22="Je ne peut pas perdre!!!"; t23="Nooooooon!!!"; t24="Merci d'avoir jouer!"; t25="Press une touche!"; } text2={ t1="Choice a language"; t2="Play"; t3="Option"; t4="About"; t5="Exit"; t6="Make a donation"; t7="Level"; t8="Level bonus"; t9="Game mode"; t10="Easy"; t11="Medium"; t12="Hard"; t13="HardCore"; t14="This time i'm"; t15="your oppenent!"; t16="No way!"; t17="I can't lose!"; t18="I'm comming back!"; t19="You again!"; t20="This time it won't"; t21="so easy"; t22="I can't lose!!!"; t23="Noooooooo!!!"; t24="Thanks you for playing!"; t25="Press any touch!"; } -- stars star={} tstar=0 sdx=-8 sheigt=30 function addStar(x,y) local s={} s.x=x s.y=y s.g=rnd(5) table.insert(star,s) end function ticStar() for k,s in pairs(star) do -- beahvior -- graphism if s.g==0 then s.g=1 end if s.g==1 or s.g==2 or s.g==3 then line(s.x,s.y,s.x+sheigt,s.y,12) s.x=s.x+sdx elseif s.g==4 then pix(s.x,s.y,12) s.x=s.x+sdx/2 elseif s.g==5 then pix(s.x,s.y,12) s.x=s.x+sdx/3 end -- remove stars if s.x<=-40 then table.remove(star,k) end end end -- ssss=0 sx=0 sy=0 tst=0 function drawStar() cls() -- sx=260 sy=rnd(0,140) tstar=tstar+1 -- addStar(sx,sy) addStar(sx,sy) addStar(sx,sy) if ssss==0 then ssss=1 for x=-40,380,5 do sy=rnd(0,140) addStar(x,sy) end end if tstar>=20 then tstar=0 sdx=sdx+0.2 sheigt=sheigt-1 end if sdx>=-1 then sdx=-1 end if sheigt<=0 then sheigt=0 end -- ticStar() end -- eax=450 eay=65 reax=4870 drawEar=0 intro=600 tintro=5 function drawEarth() -- skip intro game if not mpl then music(5,-1,-1,false,true) mpl=true end if btnp()~=0 then ssss=0 tst=0 tstar=0 sdx=-8 sheigt=30 eax=450 eay=65 reax=4870 drawEar=0 intro=600 tintro=5 zero=menu mpl=false end -- if drawEar==0 then drawStar() -- circ(eax,eay,40,0) circb(eax,eay,40,12) -- if eax<=120 then eax=120 end eax=eax-0.5 -- print("OdiStudio",eax-22,eay-5,12) print("Games",eax-13,eay+5,12) -- reax=reax-5 rect(reax,-5,1900,150,0) end if reax<=-1100 then drawEar=1 cls(0) end -- if drawEar==1 and tst<=250 then print("Present",eax-60,eay-20,12,1,4,1) table.remove(star) -- the game presented elseif drawEar==1 and tst>=350 then map(0,0,30,17) spr(248,eax-100,eay-20,0,3,0,0,8,1) if intro<=0 then intro=0 elseif intro>0 then circ(eax,eay,intro,0) end if tst>350 and tst<=650 then intro=intro-tintro elseif tst>720 and tst<=800 then intro=intro+tintro end end -- if drawEar==1 or drawEar==2 then tst=tst+1 table.remove(star) end if tst>=800 and drawEar==1 then cls(0) drawEar=2 eax=450 eay=65 reax=4870 ssss=0 intro=600 tst=0 tstar=0 sdx=-8 sheigt=30 mpl=false table.remove(star) end if tst>=200 and drawEar==2 then tst=0 drawEar=0 zero=menu mpl=false end end -- draw scrolling vertical -- gere scrolling circle sc={} function addCir() local c={} c.x=rnd(-3,190) c.y=-30 c.dy=rnd(20.0)/35 c.r=rnd(2,8) c.rr=0 c.c=rnd(1,8) table.insert(sc,c) end function ticCir() for k,c in pairs(sc) do -- value c.y=c.y+c.dy c.y=c.y+c.rr -- beavhior if c.r==8 then c.rr=-0.025 elseif c.r==7 then c.rr=-0.02 elseif c.r==6 then c.rr=-0.01 elseif c.r==5 then c.rr=0.1 elseif c.r==4 then c.rr=0.2 elseif c.r==3 then c.rr=0.4 elseif c.r==2 then c.rr=0.6 else c.rr=0 end -- graphisme circ(c.x,c.y,c.r,c.c) if c.c==1 then circb(c.x,c.y,c.r,15) else circb(c.x,c.y,c.r,c.c-1) end -- remove if c.y>=160 then table.remove(sc,k) end end end -- gere scrolling pixel sp={} function addPix() local pi={} pi.x=rnd(180) pi.y=-20 pi.dy=rnd(20.0)/30 pi.c=rnd(1,8) table.insert(sp,pi) end function ticPix() for k,pi in pairs(sp) do -- value pi.y=pi.y+pi.dy -- graphisme pix(pi.x,pi.y,pi.c) -- remove if pi.y>=150 then table.remove(sp,k) end end end -- explosion particles particles={} function addParticles(x,y,c) local par={} par.x=x par.y=y par.dx=rnd(-40.0,40.0)/20 par.dy=rnd(-40.0,40.0)/20 par.c=c par.t=0 par.mt=10 table.insert(particles,par) end function ticParticles() for k,par in pairs(particles) do par.t=par.t+1 par.x=par.x+par.dx par.y=par.y+par.dy -- graphism pix(par.x,par.y,par.c) -- remove particles if par.t>=par.mt then table.remove(particles,k) end end end -- explosion explosion={} function addExplosion(x,y) local ex={} ex.x=x+rnd(-60.0,60.0)/10 ex.y=y+rnd(-60.0,60.0)/10 ex.r=8 ex.c=4 ex.cc=3 table.insert(explosion,ex) end function ticExplosion() ticParticles() for k,ex in pairs(explosion) do ex.r=ex.r-0.5 -- graphism circ(ex.x,ex.y,ex.r,ex.c) circb(ex.x,ex.y,ex.r,ex.cc) addParticles(ex.x,ex.y,ex.c) if ex.r>=4 and ex.r<=5 then ex.c=3 ex.cc=2 elseif ex.r>=3 and ex.r<4 then ex.c=2 ex.cc=14 elseif ex.r>=2 and ex.r<3 then ex.c=14 ex.cc=15 elseif ex.r<2 then ex.c=15 ex.cc=0 end -- remove explosion if ex.r<=0 then table.remove(explosion,k) end end end -- bulletMob={} function addBulletMob(x,y,g) local bm={} bm.x=x bm.y=y bm.g=g bm.dx=rnd(-40.0,40.0)/40 bm.dy=rnd(-40.0,40.0)/40 bm.dy1=2 bm.sp=0 bm.t=0 bm.scale=1 table.insert(bulletMob,bm) end function ticBulletMob() for k,bm in pairs(bulletMob) do if bm.g==1 then -- value bm.y=bm.y+bm.dy1 bm.sp=272 bm.t=bm.t+1 elseif bm.g==2 then -- value bm.x=bm.x+bm.dx bm.y=bm.y+bm.dy bm.sp=273+bm.t%20//10 bm.t=bm.t+1 elseif bm.g==3 then -- value bm.y=bm.y+bm.dy1 bm.sp=272 spr(bm.sp,bm.x+10,bm.y,0,bm.scale) bm.t=bm.t+1 elseif bm.g==4 then -- value bm.y=bm.y+bm.dy1*4 bm.sp=275+bm.t%4//2 bm.t=bm.t+1 bm.scale=2 end -- graphisme spr(bm.sp,bm.x,bm.y,0,bm.scale) -- collision witch player for s,p in pairs(player) do if p.x<=bm.x+8 and p.x>=bm.x-16 and p.y<=bm.y+8 and p.y>=bm.y-16 and protect==0 then table.remove(bulletMob,k) sfx(6,"C-1",-1,1,volume) protect=1 mod=mod-1 gb1=gb1-1 gb2=gb2-1 for i=1,5 do addExplosion(p.x+5,p.y+5) end elseif p.x <= bm.x+15 and p.x >= bm.x-15 and p.y <= bm.y+15 and p.y >= bm.y-15 and protect==0 and bm.g==3 then sfx(6,"C-1",-1,1,volume) protect=1 mod=mod-1 gb1=gb1-1 gb2=gb2-1 for i=1,5 do addExplosion(p.x+5,p.y+5) end elseif p.x <= bm.x+15 and p.x >= bm.x-15 and p.y <= bm.y+15 and p.y >= bm.y-15 and protect==0 and bm.g==4 then sfx(6,"C-1",-1,1,volume) protect=1 mod=mod-4 gb1=gb1-1 gb2=gb2-1 for i=1,5 do addExplosion(p.x+5,p.y+5) end end end -- remove bullet if bm.t>=300 then addExplosion(bm.x,bm.y) table.remove(bulletMob,k) elseif bm.x>=180 or bm.x<=-20 or bm.y>=180 or bm.y<=-20 then table.remove(bulletMob,k) end end end -- mob={} function addMob(x,y) local m={} m.x=x m.y=y m.dx=rnd(-20.0,20.0)/30 m.dy=rnd(10.0,20.0)/50 m.dx1=rnd(-20.0,20.0)/10 m.dy1=rnd(20.0,20.0)/50 m.g=rnd(10) m.addPowerUp=rnd(4) m.gm=0 m.sp=0 m.flip=0 m.t=0 m.tt=0 m.fire=0 m.ff=0 m.live=0 table.insert(mob,m) end function ticMob() for k,m in pairs(mob) do m.fire=m.fire+1 if m.g==0 then m.g=1 end m.tt=m.tt+1 -- if m.y<=-15 then spr(4,m.x,5,0,1) end -- mob 1 basique if m.g==1 then -- condition de base if m.gm==0 then m.gm=1 m.live=1 end -- valu m.x=m.x+m.dx m.y=m.y+m.dy -- graphisme spr(17,m.x,m.y,0,2) -- beavhior if m.x>=180 then m.x=-10 elseif m.x<=-20 then m.x=180 end if m.fire>=500 then m.fire=0 sfx(7,"G-3",-1,1,volume) addBulletMob(m.x,m.y+10,1) addBulletMob(m.x+10,m.y+10,1) end if m.y>=180 then m.y=-40 end end -- mob 2 Donteur if m.g==2 then -- condition de base if m.gm==0 then m.gm=1 m.live=3 end -- valu m.x=m.x+m.dx m.y=m.y+m.dy*2 -- graphisme spr(18,m.x,m.y,0,2) -- beavhior if m.fire>=200 then m.fire=0 sfx(7,"G-3",-1,1,volume) addBulletMob(m.x+5,m.y+12,1) end if m.x>=180 then m.x=-10 elseif m.x<=-20 then m.x=180 end if m.y>=180 then m.y=-40 end end -- mob 3 Spinner if m.g==3 then -- condition de base if m.gm==0 then m.gm=1 m.live=6 end -- valu m.y=m.y+m.dy -- graphisme spr(33+m.tt%20//10,m.x,m.y,0,2) -- beavhior if m.x>=160 then m.x=0 elseif m.x<=0 then m.x=160 end if m.y>=50 and m.t<=300 then m.y=50 m.t=m.t+1 if m.t>=50 and m.fire>=20 then m.fire=0 sfx(7,"G-3",-1,1,volume) addBulletMob(m.x+6,m.y+6,2) end else m.x=m.x+m.dx*2 end if m.y>=180 then m.y=-40 m.t=0 end end -- mob 4 SpawnTager if m.g==4 then -- condition de base if m.gm==0 then m.gm=1 m.live=8 end -- valu m.y=m.y+m.dy -- graphisme spr(25,m.x,m.y,0,2) -- beavhior if m.y>=35 and m.t<=300 then m.y=35 m.t=m.t+1 if m.t>=50 and m.fire>=30 then m.fire=0 sfx(7,"G-3",-1,1,volume) addBulletMob(m.x+4,m.y+14,1) addBulletMob(m.x+10,m.y+14,1) end end if m.y>=180 then m.y=-40 m.x=rnd(10,150) m.t=0 end end -- mob 5 Parycont if m.g==5 then -- condition de base if m.gm==0 then m.gm=1 m.live=4 end -- valu m.y=m.y+m.dy m.x=m.x+m.dx -- graphisme spr(18,m.x,m.y,0,2) -- beavhior if m.x>=160 then m.x=m.x-m.dx elseif m.x<=0 then m.x=m.x-m.dx end if m.y>=180 then m.y=-40 end end -- mob 6 Elagueur if m.g==6 then -- condition de base if m.gm==0 then m.gm=1 m.live=10 end -- valu m.y=m.y+m.dy m.x=m.x+(m.dx1+sin(m.tt/25)*0.915)/1.4 -- graphisme spr(19,m.x,m.y,0,2) -- beavhior if m.fire>=100 then m.fire=0 sfx(7,"G-3",-1,1,volume) addBulletMob(m.x,m.y+12,1) addBulletMob(m.x+10,m.y+12,1) end if m.x>=170 then m.x=-10 elseif m.x<=-10 then m.x=170 end if m.y>=180 then m.y=-40 end end -- mob 7 Shokeur if m.g==7 then -- condition de base if m.gm==0 then m.gm=1 m.live=13 m.dx=0 end -- valu m.y=m.y+m.dy m.x=m.x+m.dx1 m.dx=m.dx+m.dx1 -- graphisme spr(21,m.x,m.y,0,2) -- beavhior if m.x>=170 then m.x=-10 elseif m.x<=-10 then m.x=170 end if m.dx>=30 then m.dx1=-m.dx1 if m.fire>=20 then m.fire=0 sfx(7,"G-3",-1,1,volume) addBulletMob(m.x,m.y+12,1) addBulletMob(m.x+10,m.y+12,1) end elseif m.dx<=-30 then m.dx1=-m.dx1 if m.fire>=20 then m.fire=0 sfx(7,"G-3",-1,1,volume) addBulletMob(m.x,m.y+12,1) addBulletMob(m.x+10,m.y+12,1) end end if m.y>=180 then m.y=-40 end end -- mob 8 spawner if m.g==8 then -- condition de base if m.gm==0 then m.gm=1 m.live=25 end -- valu m.x=m.x+m.dx m.y=m.y+m.dy -- beavhior if m.x>=180 then m.x=-10 elseif m.x<=-20 then m.x=180 end if m.sp>=1 and m.y>=25 then m.sp=0 addMob(m.x+8,m.y+16) for s,par in pairs(particles) do par.mt=20 end for i=1,150 do addParticles(m.x+10,m.y+28,12) end sfx(6,"C-3",-1,1,volume) end -- graphisme spr(22,m.x,m.y,0,3) -- remove mob -- remove collision witch bullet mob for s,p in pairs(pbullet1) do if p.x<=m.x+24 and p.x>=m.x-12 and p.y<=m.y+24 and p.y>=m.y-12 and p.laser==0 then m.live=m.live-1 for i=1,2 do addExplosion(p.x,p.y) end table.remove(pbullet1,s) sfx(6,"C-1",-1,1,volume) end end for s,p in pairs(pbullet2) do if p.x<=m.x+24 and p.x>=m.x-12 and p.y<=m.y+24 and p.y>=m.y-12 and p.laser==0 then m.live=m.live-1 for i=1,2 do addExplosion(p.x,p.y) end table.remove(pbullet2,s) end end for s,p in pairs(pbullet3) do if p.x<=m.x+24 and p.x>=m.x-12 and p.y<=m.y+24 and p.y>=m.y-12 and p.laser==0 then m.live=m.live-1 for i=1,2 do addExplosion(p.x,p.y) end table.remove(pbullet3,s) sfx(6,"C-1",-1,1,volume) end end -- collision witch bullet laser for s,p in pairs(pbullet1) do if p.x<=m.x+24 and p.x>=m.x-12 and p.y<=m.y+24 and p.y>=m.y-12 and p.laser==1 then m.live=m.live-0.2 for i=1,2 do addExplosion(p.x,p.y) end sfx(6,"C-1",-1,1,volume) end end for s,p in pairs(pbullet2) do if p.x<=m.x+24 and p.x>=m.x-12 and p.y<=m.y+24 and p.y>=m.y-12 and p.laser==1 then m.live=m.live-0.2 for i=1,2 do addExplosion(p.x,p.y) end end end for s,p in pairs(pbullet3) do if p.x<=m.x+24 and p.x>=m.x-12 and p.y<=m.y+24 and p.y>=m.y-12 and p.laser==1 then m.live=m.live-0.2 for i=1,2 do addExplosion(p.x,p.y) end sfx(6,"C-1",-1,1,volume) end end if m.y>=180 then m.sp=m.sp+1 m.y=-60 end end -- mob 9 hunter 1 if m.g==9 then -- condition de base if m.gm==0 then m.gm=1 m.live=8 end -- valu m.x=m.x m.y=m.y+m.dy -- graphisme spr(23,m.x,m.y,0,2) -- beavhior for s,p in pairs(player) do if p.x>=m.x then m.x=m.x+0.8 elseif p.x<=m.x then m.x=m.x-0.8 end end if m.fire>=900 then addParticles(m.x+8,m.y+11,2) addParticles(m.x+8,m.y+11,3) addParticles(m.x+8,m.y+11,4) end if m.fire>=1000 and m.y>=10 and m.y<=90 and m.ff>=0 then m.ff=m.ff+1 sfx(7,"G-2",-1,1,volume) addBulletMob(m.x,m.y+3,4) end if m.fire>=1000 and m.ff==0 then if m.y<10 or m.y>90 then m.fire=1000 end end if m.fire>=1050 and m.ff>=0 then m.fire=0 m.ff=0 end if m.y>=160 then m.y=-40 end end -- mob 10 hunter 2 if m.g==10 then -- condition de base if m.gm==0 then m.gm=1 m.live=8 end -- valu m.x=m.x m.y=m.y+m.dy*2 -- graphisme spr(24,m.x,m.y,0,2,m.flip) -- beavhior for s,p in pairs(player) do m.x=p.x if p.anim==1 then spr(81+m.tt%10//3,m.x,m.y,0,2) end end if m.y>=150 and m.gm==1 then m.gm=2 m.flip=3 m.dy=-m.dy end if m.y<=-20 and m.gm==2 then m.y=160 end end -- collision witch bullet -- remove collision witch bullet mob for s,p in pairs(pbullet1) do if p.x<=m.x+12 and p.x>=m.x-12 and p.y<=m.y+12 and p.y>=m.y-12 and p.laser==0 and m.g~=8 then m.live=m.live-1 for i=1,2 do addExplosion(p.x,p.y) end table.remove(pbullet1,s) sfx(6,"C-1",-1,1,volume) end end for s,p in pairs(pbullet2) do if p.x<=m.x+12 and p.x>=m.x-12 and p.y<=m.y+12 and p.y>=m.y-12 and p.laser==0 and m.g~=8 then m.live=m.live-1 for i=1,2 do addExplosion(p.x,p.y) end table.remove(pbullet2,s) end end for s,p in pairs(pbullet3) do if p.x<=m.x+12 and p.x>=m.x-12 and p.y<=m.y+12 and p.y>=m.y-12 and p.laser==0 and m.g~=8 then m.live=m.live-1 for i=1,2 do addExplosion(p.x,p.y) end table.remove(pbullet3,s) sfx(6,"C-1",-1,1,volume) end end -- collision witch bullet laser for s,p in pairs(pbullet1) do if p.x<=m.x+12 and p.x>=m.x-12 and p.y<=m.y+12 and p.y>=m.y-12 and p.laser==1 and m.g~=8 then m.live=m.live-0.3 for i=1,2 do addExplosion(p.x,p.y) end sfx(6,"C-1",-1,1,volume) end end for s,p in pairs(pbullet2) do if p.x<=m.x+12 and p.x>=m.x-12 and p.y<=m.y+12 and p.y>=m.y-12 and p.laser==1 and m.g~=8 then m.live=m.live-0.3 for i=1,2 do addExplosion(p.x,p.y) end end end for s,p in pairs(pbullet3) do if p.x<=m.x+12 and p.x>=m.x-12 and p.y<=m.y+12 and p.y>=m.y-12 and p.laser==1 and m.g~=8 then m.live=m.live-0.3 for i=1,2 do addExplosion(p.x,p.y) end sfx(6,"C-1",-1,1,volume) end end -- remove mob and add score if m.live<=0 and m.g==8 then table.remove(mob,k) sfx(5,"C-3",-1,1,volume) if m.addPowerUp==4 then addPower(m.x+14,m.y+8) end for i=1,20,2 do addExplosion(m.x+i,m.y+i) addExplosion(m.x-i,m.y+i) end elseif m.live<=0 then table.remove(mob,k) sfx(5,"C-3",-1,1,volume) if m.addPowerUp==4 then addPower(m.x+6,m.y+4) end for i=1,10 do addExplosion(m.x,m.y) end end if m.live<=0 then score.sc=score.sc+10*m.g end end end -- boss boss={} function addBoss(g) local b={} b.x=70 b.y=-30 b.dx=1.5 b.dy=0.5 b.g=g b.berserk=0 b.berserkTime=0 b.tack=0 b.te=0 b.tet=0 b.gm=0 b.fo=0 b.ff=0 b.fire=0 b.t=0 b.tt=0 b.live=0 b.spawn=0 b.spTime=0 b.cin=0 b.cine=0 b.cinet=0 table.insert(boss,b) end function ticBoss() for k,b in pairs(boss) do b.tt=b.tt+1 if b.berserk==1 then b.berserkTime=b.berserkTime+1 end if b.berserkTime>30 then b.berserkTime=0 for i=1,4 do addExplosion(b.x+16,b.y+14) end sfx(6,"C-1",-1,1,volume) end -- valu if b.spawn==0 then b.spTime=b.spTime+1 if b.y<=8 then b.y=b.y+0.8 end if b.spTime>=300 then b.spawn=1 b.spTime=0 end end -- boss 1 if b.g==1 then -- condition de base if b.gm==0 then b.gm=1 b.live=300 end -- graphisme spr(49,b.x,b.y,0,2,0,0,2,2) if b.spawn==1 then b.y=b.y+b.dy if b.tack>=2 then b.tack=2 end -- beavhior if b.ff>=1 then for i=1,3 do addBulletMob(b.x+20,b.y+20,2) end sfx(7,"G-3",-1,1,volume) b.ff=0 end ---- if b.live>=125 then b.x=b.x+b.dx if b.x>=150 then b.dx=-b.dx b.tack=b.tack+1 b.ff=1 elseif b.x<=-5 then b.dx=-b.dx b.tack=b.tack+1 b.ff=1 end end -- mode berseker if b.live<125 then b.x=b.x+b.dx*1.4 b.berserk=1 if b.tack<=0 then if b.x>=10 and b.x<=120 and b.tack==0 then b.tack=b.tack+rnd(2) b.ff=1 end end -- if b.x>=150 and b.tack==1 then b.dx=-b.dx b.tack=b.tack+rnd(2) b.ff=1 elseif b.x<=-5 and b.tack==1 then b.dx=-b.dx b.tack=b.tack+rnd(2) b.ff=1 end -- if b.x>=180 and b.tack>=2 then b.x=-50 b.tack=b.tack-2 b.te=1 b.ff=1 elseif b.x<=-40 and b.tack>=2 then b.x=190 b.tack=b.tack-2 b.te=1 b.ff=1 end end -- if b.te==1 then b.tet=b.tet+1 spr(81+b.tet%9//3,b.x-2,b.y,0,4) end if b.tet>=30 then b.te=0 b.tet=0 end -------------- if b.y>=180 then b.y=-50 b.fire=1 end if b.y>=-20 and b.fire==1 then b.fire=0 for i=1,11 do addExplosion(b.x+6+i*2,b.y+24) end addBulletMob(b.x+6,b.y+24,1) addBulletMob(b.x+14,b.y+29,1) addBulletMob(b.x+20,b.y+29,1) addBulletMob(b.x+28,b.y+24,1) sfx(7,"G-3",-1,1,volume) end end end -- boss 2 if b.g==2 then -- condition de base if b.gm==0 then b.gm=1 b.live=340 b.dy=1 end -- valu -- graphisme spr(51,b.x,b.y,0,2,0,0,2,2) -- beavhior if b.spawn==1 then if b.live>=150 and b.tack<=4 then if b.x>=150 then b.dx=-b.dx elseif b.x<=-5 then b.dx=-b.dx end if b.y>=120 then b.dy=3 b.dy=-b.dy b.fo=1 elseif b.y<=-5 and b.fo==1 then b.ff=1 b.dy=-1 b.dy=-b.dy b.tack=b.tack+1 end elseif b.live<150 and b.tack<=4 then b.berserk=1 if b.x>=150 then b.dx=-b.dx elseif b.x<=-5 then b.dx=-b.dx end if b.y>=120 then b.dy=3 b.dy=-b.dy b.fo=1 elseif b.y<=-5 and b.fo==1 then b.ff=1 b.dy=-4 b.dy=-b.dy b.tack=b.tack+1 end end -- add laser boss if b.tack>=5 then b.te=b.te+1 if b.te<220 then addParticles(b.x+14,b.y+34,2) addParticles(b.x+14,b.y+34,3) addParticles(b.x+14,b.y+34,4) end if b.te>=150 and b.te<220 then addBulletMob(b.x+9,b.y+22,4) end if b.te>=300 then b.tack=0 b.te=0 end if b.berserk==1 then for s,p in pairs(player) do if b.x>p.x then b.x=b.x-0.8 elseif b.x=2 then b.ff=0 b.tet=0 for i=1,4 do addExplosion(b.x+16,b.y+24) end addBulletMob(b.x+14,b.y+24,1) addBulletMob(b.x+20,b.y+24,1) sfx(7,"G-3",-1,1,volume) end end end -- end end -- boss 3 if b.g==3 then -- condition de base if b.gm==0 then b.gm=1 b.live=450 b.dx=1.5 b.dy=1.5 end -- graphisme spr(53,b.x,b.y,0,2,0,0,2,2) -- beavhior if b.spawn==1 then if b.live<170 then b.berserk=1 end if b.tack<=5 then -- valu b.y=b.y+b.dy b.x=b.x+b.dx if b.x>=150 then b.dx=-b.dx elseif b.x<=-5 then b.dx=-b.dx end if b.y>=120 then b.dy=-b.dy b.fo=1 b.tack=b.tack+1 elseif b.y<=-5 and b.fo==1 then b.dy=-b.dy b.tack=b.tack+1 b.ff=b.ff+1 end if b.ff==1 then b.ff=0 for i=1,3 do addExplosion(b.x+10,b.y+28) addExplosion(b.x+28,b.y+28) end addBulletMob(b.x+10,b.y+28,1) addBulletMob(b.x+28,b.y+28,1) sfx(7,"G-3",-1,1,volume) end -- add missile boss elseif b.tack>=6 then if b.berserk==1 then for s,p in pairs(player) do if b.x>p.x-12 and b.x>-4 then b.x=b.x-0.8 elseif b.x=150 and b.te<220 then b.tet=b.tet+1 if b.tet>=3 then b.tet=0 addAste1(b.x+14.5,b.y+27,2) end end if b.te>=300 then b.tack=0 b.te=0 end end end end -- boss 4 if b.g==4 then -- condition de base if b.gm==0 then b.gm=1 b.live=500 b.dx=1.5 b.dy=1.5 end if b.cin==0 then b.cinet=b.cinet+1 if b.cinet>=100 and b.cinet<200 then print(text.t14,40,100,12,4) print(text.t15,40,110,12,4) elseif b.cinet>=200 then b.cinet=0 b.cin=1 end end -- graphisme spr(55,b.x,b.y,0,2,0,0,2,2) -- beavhior if b.spawn==1 and b.cin==1 then if b.live<170 then b.berserk=1 end if b.tack<=0 then -- valu b.x=b.x+b.dx b.te=b.te+1 if b.y>=-10 then b.tet=b.tet+1 end if b.tet>=50 then b.tet=0 b.ff=1 end if b.te>=500 then b.y=b.y+b.dy end if b.te>=700 and b.y>-4 and b.y<10 then b.te=0 b.tack=b.tack+1 end if b.x>=150 then b.dx=-b.dx elseif b.x<=-5 then b.dx=-b.dx end if b.y>=160 then b.y=-180 b.fo=1 addMob(30,-40) addMob(80,-40) end if b.ff==1 then b.ff=0 for i=1,3 do addExplosion(b.x+6,b.y+25) addExplosion(b.x+12,b.y+25) addExplosion(b.x+18,b.y+25) addExplosion(b.x+24,b.y+28) end addBulletMob(b.x+6,b.y+27,1) addBulletMob(b.x+12,b.y+25,1) addBulletMob(b.x+18,b.y+25,1) addBulletMob(b.x+24,b.y+28,1) sfx(7,"G-3",-1,1,volume) end elseif b.tack>=1 then if b.x>=50 and berserk==0 then b.x=b.x-0.8 elseif b.x<=45 and berserk==0 then b.x=b.x+0.8 end if b.berserk==1 then for s,p in pairs(player) do if b.x>p.x-12 and b.x>-4 then b.x=b.x-0.8 elseif b.x=150 and b.te<220 and b.berserk==0 then b.tet=b.tet+1 if b.tet>=3 then b.tet=0 addAste1(b.x+10.5,b.y+19,2) end elseif b.te>=150 and b.te<220 and b.berserk==1 then addBulletMob(b.x+10,b.y+18,4) end -- if b.te>=400 then b.tack=0 b.te=0 end end if b.live<=15 then b.live=15 if b.cine==0 then b.te=0 b.tet=0 b.tack=0 b.cine=1 elseif b.cine==1 then b.te=b.te+1 if b.te<400 then if b.x<60 then b.x=b.x+0.8 elseif b.x>70 then b.x=b.x-0.8 end if b.y<10 then b.y=b.y+0.8 elseif b.y>20 then b.y=b.y-0.8 end end if b.te>=100 and b.te<200 then print(text.t16,50,100,12,2) elseif b.te>=200 and b.te<300 then print(text.t17,30,100,12,2) elseif b.te>=300 and b.te<400 then print(text.t18,50,100,12,2) end if b.te>=400 then b.y=b.y-0.8 end if b.te>=500 then b.live=0 end end end end end -- boss 5 if b.g==5 then -- condition de base if b.gm==0 then b.gm=1 b.live=340 b.dx=1.5 b.dy=1.5 end -- graphisme if b.cine==0 then if b.tack<3 then b.cinet=b.cinet+1 end if b.cinet<100 then spr(55,b.x,b.y,0,2,0,0,2,2) b.te=b.te+1 elseif b.cinet>=100 and b.cinet<200 then spr(57,b.x,b.y,0,2,0,0,2,2) b.te=b.te+1 elseif b.cinet>=200 and b.cinet<400 then spr(60,b.x-8,b.y,0,2,0,0,3,2) b.te=b.te+1 end if b.cinet>=100 and b.cinet<=200 then print(text.t19,60,120,12,2) elseif b.cinet>=200 and b.cinet<=300 then print(text.t20,20,110,12,2) print(text.t21,50,120,12,2) end if b.te>=80 and b.tack<2 then b.tet=b.tet+1 if b.tet<20 then sfx(3,"C-1",-1,1,volume) spr(81+b.tt%10//3,b.x+5,b.y,0,3) elseif b.tet>=20 then b.tet=0 b.te=0 b.tack=b.tack+1 end end if b.cinet>=400 then spr(61,b.x,b.y,0,2,0,0,1,2) b.te=0 b.tet=0 b.tack=0 b.cine=1 b.cinet=0 addBoss(6) addBoss(7) end end -- beavhior if b.spawn==1 and b.cine==1 then spr(61,b.x,b.y,0,2,0,0,1,2) if b.live<170 then b.berserk=1 end if b.tack<=0 then -- valu b.x=b.x+b.dx b.te=b.te+1 if b.y>=-10 then b.tet=b.tet+1 end if b.tet>=50 then b.tet=0 b.ff=1 end if b.te>=500 then b.y=b.y+b.dy end if b.te>=700 and b.y>-4 and b.y<10 then b.te=0 b.tack=b.tack+1 end if b.x>=150 then b.dx=-b.dx elseif b.x<=-5 then b.dx=-b.dx end if b.y>=160 then b.y=-180 b.fo=1 for i=1,10 do addAste2(70,-40,2) end end if b.ff==1 then b.ff=0 for i=1,3 do addExplosion(b.x+7,b.y+27) end addBulletMob(b.x+7,b.y+27,1) sfx(7,"G-3",-1,1,volume) end elseif b.tack>=1 then if b.x>=50 and berserk==0 then b.x=b.x-0.8 elseif b.x<=45 and berserk==0 then b.x=b.x+0.8 end if b.berserk==1 then for s,p in pairs(player) do if b.x>p.x-12 and b.x>-4 then b.x=b.x-0.8 elseif b.x=150 and b.te<220 and b.berserk==0 then b.tet=b.tet+1 if b.tet>=3 then b.tet=0 addAste2(b.x+2,b.y+25,2) end elseif b.te>=150 and b.te<220 and b.berserk==1 then addBulletMob(b.x+2,b.y+25,4) end -- if b.te>=400 then b.tack=0 b.te=0 end end if b.live<=15 then b.live=15 if b.cine==0 then b.te=0 b.tet=0 b.tack=0 b.cine=1 elseif b.cine==1 then b.te=b.te+1 if b.te<400 then if b.x<60 then b.x=b.x+0.8 elseif b.x>70 then b.x=b.x-0.8 end if b.y<10 then b.y=b.y+0.8 elseif b.y>20 then b.y=b.y-0.8 end end if b.te>=100 and b.te<200 then print(text.t16,50,100,12,2) elseif b.te>=200 and b.te<300 then print(text.t22,30,100,12,2) elseif b.te>=300 and b.te<400 then print(text.t23,50,100,12,2) end if b.te>=400 then b.y=b.y-0.8 end if b.te>=500 then b.live=0 end end end end end -- boss 6 if b.g==6 then -- condition de base if b.gm==0 then b.gm=1 b.live=250 b.dx=1.5 b.dy=1.5 b.y=8 b.x=50 end -- graphisme spr(59,b.x,b.y,0,2,0,0,2,2) -- beavhior if b.spawn==1 then if b.live<70 then b.berserk=1 end if b.tack<=0 then -- valu b.x=b.x+b.dx if b.y<15 then b.y=b.y+0.8 end if b.y>=15 then b.tet=b.tet+1 end if b.tet>=90 then b.tet=0 b.ff=1 end if b.x>=150 then b.dx=-b.dx elseif b.x<=-5 then b.dx=-b.dx end if b.ff==1 then b.ff=0 for i=1,3 do addExplosion(b.x+14,b.y+27) addExplosion(b.x+22,b.y+26) end addBulletMob(b.x+14,b.y+27,1) addBulletMob(b.x+22,b.y+26,1) sfx(7,"G-3",-1,1,volume) end end end end -- boss 7 if b.g==7 then -- condition de base if b.gm==0 then b.gm=1 b.live=250 b.dx=1.5 b.dy=1.5 b.y=8 b.x=90 end -- graphisme spr(62,b.x,b.y,0,2,0,0,2,2) -- beavhior if b.spawn==1 then if b.live<70 then b.berserk=1 end if b.tack<=0 then -- valu b.x=b.x+b.dx if b.y<30 then b.y=b.y+0.8 end if b.y>=30 then b.tet=b.tet+1 end if b.tet>=180 then b.tet=0 b.ff=1 end if b.x>=150 then b.dx=-b.dx elseif b.x<=-5 then b.dx=-b.dx end if b.ff==1 then b.ff=0 for i=1,3 do addExplosion(b.x+14,b.y+27) addExplosion(b.x+22,b.y+26) end addAste2(b.x+14,b.y+27,2) addAste2(b.x+22,b.y+26,2) sfx(7,"G-3",-1,1,volume) end end end end -- collision bullet and player witch boss -- remove collision witch bullet mob for s,p in pairs(pbullet1) do if p.x<=b.x+35 and p.x>=b.x-15 and p.y<=b.y+35 and p.y>=b.y-15 and p.laser==0 then b.live=b.live-1 for i=1,2 do addExplosion(p.x,p.y) end table.remove(pbullet1,s) sfx(6,"C-1",-1,1,volume) end end for s,p in pairs(pbullet2) do if p.x<=b.x+35 and p.x>=b.x-15 and p.y<=b.y+35 and p.y>=b.y-15 and p.laser==0 then b.live=b.live-1 for i=1,2 do addExplosion(p.x,p.y) end table.remove(pbullet2,s) end end for s,p in pairs(pbullet3) do if p.x<=b.x+35 and p.x>=b.x-15 and p.y<=b.y+35 and p.y>=b.y-15 and p.laser==0 then b.live=b.live-1 for i=1,2 do addExplosion(p.x,p.y) end table.remove(pbullet3,s) sfx(6,"C-1",-1,1,volume) end end -- collision witch bullet laser for s,p in pairs(pbullet1) do if p.x<=b.x+35 and p.x>=b.x-15 and p.y<=b.y+35 and p.y>=b.y-15 and p.laser==1 then b.live=b.live-0.2 for i=1,2 do addExplosion(p.x,p.y) end sfx(6,"C-1",-1,1,volume) end end for s,p in pairs(pbullet2) do if p.x<=b.x+35 and p.x>=b.x-15 and p.y<=b.y+35 and p.y>=b.y-15 and p.laser==1 then b.live=b.live-0.2 for i=1,2 do addExplosion(p.x,p.y) end end end for s,p in pairs(pbullet3) do if p.x<=b.x+35 and p.x>=b.x-15 and p.y<=b.y+35 and p.y>=b.y-15 and p.laser==1 then b.live=b.live-0.2 for i=1,2 do addExplosion(p.x,p.y) end sfx(6,"C-1",-1,1,volume) end end -- remove boss if b.live<=0 then for i=1,30 do addExplosion(b.x,b.y) end table.remove(boss,k) sfx(5,"C-3",-1,1,volume) end ---- if b.live<=0 and b.g==1 then score.sc=score.sc+1000*b.g end end end -- -- Asteroid aste1={} aste2={} aste3={} -- Asteroid 1 function addAste1(x,y,sp) local as1 = {} as1.x=x as1.y=y as1.dx = rnd(-40.0,40.0)/50 as1.dy = rnd(60.0)/50 as1.live=1 as1.t = 0 as1.explo=30 as1.exploTime=1 as1.sp=sp table.insert(aste1,as1) end function ticAste1() for k,as1 in pairs(aste1) do as1.t = as1.t + 1 as1.x = as1.x - as1.dx as1.y = as1.y + as1.dy as1.explo=as1.explo as1.exploTimes=as1.exploTime as1.live = as1.live -- graphism if as1.sp==1 then spr(304,as1.x,as1.y,0,2,0) elseif as1.sp==2 then spr(320,as1.x,as1.y,0,2,0) end --remove old ones if as1.y>=160 or as1.x<-20 or as1.x>190 then table.remove(aste1,k) end if as1.live <= 0 then table.remove(aste1,k) addAste2(as1.x+8,as1.y+2,as1.sp) addAste2(as1.x-8,as1.y-6,as1.sp) score.sc=score.sc+5 as1.explo=as1.explo-30 end if as1.explo<30 then as1.explo=as1.explo+as1.exploTime for i=1,3 do addExplosion(as1.x,as1.y) end end -- collision witch bullet player for i,v in pairs(pbullet1) do if v.x <= as1.x+15 and v.x >= as1.x-15 and v.y <= as1.y+15 and v.y >= as1.y-15 and v.laser==0 then as1.live=as1.live-1 sfx(6,"C-1",-1,1,volume) table.remove(pbullet1) end end for i,v in pairs(pbullet2) do if v.x <= as1.x+15 and v.x >= as1.x-15 and v.y <= as1.y+15 and v.y >= as1.y-15 and v.laser==0 then as1.live=as1.live-1 sfx(6,"C-1",-1,1,volume) table.remove(pbullet2) end end for i,v in pairs(pbullet3) do if v.x <= as1.x+15 and v.x >= as1.x-15 and v.y <= as1.y+15 and v.y >= as1.y-15 and v.laser==0 then as1.live=as1.live-1 sfx(6,"C-1",-1,1,volume) table.remove(pbullet3) end end -- collision witch bullet player laser for i,v in pairs(pbullet1) do if v.x <= as1.x+15 and v.x >= as1.x-15 and v.y <= as1.y+15 and v.y >= as1.y-15 and v.laser==1 then as1.live=as1.live-0.2 sfx(6,"C-1",-1,1,volume) end end for i,v in pairs(pbullet2) do if v.x <= as1.x+15 and v.x >= as1.x-15 and v.y <= as1.y+15 and v.y >= as1.y-15 and v.laser==1 then as1.live=as1.live-0.2 sfx(6,"C-1",-1,1,volume) end end for i,v in pairs(pbullet3) do if v.x <= as1.x+15 and v.x >= as1.x-15 and v.y <= as1.y+15 and v.y >= as1.y-15 and v.laser==1 then as1.live=as1.live-0.2 sfx(6,"C-1",-1,1,volume) end end -- collision witch player for i,v in pairs(player) do if v.x <= as1.x+15 and v.x >= as1.x-15 and v.y <= as1.y+15 and v.y >= as1.y-15 and protect==0 then as1.live=as1.live-1 sfx(6,"C-1",-1,1,volume) protect=1 mod=mod-1 gb1=gb1-1 gb2=gb2-1 end end end ticAste2() end -- Asteroid 2 function addAste2(x,y,sp) local as2 = {} as2.x=x as2.y=y as2.dx=rnd(-40.0,40.0)/50 as2.dy=rnd(60.0)/50 as2.live=1 as2.t = 0 as2.explo=30 as2.exploTime=1 as2.sp=sp table.insert(aste2,as2) end function ticAste2() for k,as2 in pairs(aste2) do as2.t = as2.t + 1 as2.x = as2.x - as2.dx as2.y = as2.y + as2.dy as2.explo=as2.explo as2.exploTimes=as2.exploTime as2.live = as2.live -- graphism if as2.sp==1 then spr(305,as2.x,as2.y,0,2,0) elseif as2.sp==2 then spr(321,as2.x,as2.y,0,2,0) end --remove old ones if as2.y>=160 or as2.x<-20 or as2.x>200 then table.remove(aste2,k) end if as2.live <= 0 then table.remove(aste2,k) addAste3(as2.x,as2.y,as2.sp) addAste3(as2.x+10,as2.y,as2.sp) addAste3(as2.x,as2.y-10,as2.sp) score.sc=score.sc+5 as2.explo=as2.explo-30 end if as2.explo<30 then as2.explo=as2.explo+as2.exploTime for i=1,3 do addExplosion(as2.x,as2.y) end end -- remove asteroid 2 -- collision witch bullet player for i,v in pairs(pbullet1) do if v.x <= as2.x+15 and v.x >= as2.x-15 and v.y <= as2.y+15 and v.y >= as2.y-15 and v.laser==0 then as2.live=as2.live-1 sfx(6,"C-1",-1,1,volume) table.remove(pbullet1) end end for i,v in pairs(pbullet2) do if v.x <= as2.x+15 and v.x >= as2.x-15 and v.y <= as2.y+15 and v.y >= as2.y-15 and v.laser==0 then as2.live=as2.live-1 sfx(6,"C-1",-1,1,volume) table.remove(pbullet2) end end for i,v in pairs(pbullet3) do if v.x <= as2.x+15 and v.x >= as2.x-15 and v.y <= as2.y+15 and v.y >= as2.y-15 and v.laser==0 then as2.live=as2.live-1 sfx(6,"C-1",-1,1,volume) table.remove(pbullet3) end end -- collision witch bullet player laser for i,v in pairs(pbullet1) do if v.x <= as2.x+15 and v.x >= as2.x-15 and v.y <= as2.y+15 and v.y >= as2.y-15 and v.laser==1 then as2.live=as2.live-0.2 sfx(6,"C-1",-1,1,volume) end end for i,v in pairs(pbullet2) do if v.x <= as2.x+15 and v.x >= as2.x-15 and v.y <= as2.y+15 and v.y >= as2.y-15 and v.laser==1 then as2.live=as2.live-0.2 sfx(6,"C-1",-1,1,volume) end end for i,v in pairs(pbullet3) do if v.x <= as2.x+15 and v.x >= as2.x-15 and v.y <= as2.y+15 and v.y >= as2.y-15 and v.laser==1 then as2.live=as2.live-0.2 sfx(6,"C-1",-1,1,volume) end end -- collision witch player for i,v in pairs(player) do if v.x <= as2.x+15 and v.x >= as2.x-15 and v.y <= as2.y+15 and v.y >= as2.y-15 and protect==0 then as2.live=as2.live-1 sfx(6,"C-1",-1,1,volume) protect=1 mod=mod-1 gb1=gb1-1 gb2=gb2-1 end end end ticAste3() end -- Asteroid 3 function addAste3(x,y,sp) local as3 = {} as3.x=x as3.y=y as3.dx = rnd(-40.0,40.0)/50 as3.dy = rnd(60.0)/50 as3.live=1 as3.t = 0 as3.explo=30 as3.exploTime=1 as3.sp=sp table.insert(aste3,as3) end function ticAste3() for k,as3 in pairs(aste3) do as3.t = as3.t + 1 as3.x = as3.x - as3.dx as3.y = as3.y + as3.dy as3.explo=as3.explo as3.exploTimes=as3.exploTime as3.live = as3.live -- graphism if as3.sp==1 then spr(306,as3.x,as3.y,0,2,0) elseif as3.sp==2 then spr(322,as3.x,as3.y,0,2,0) end --remove old ones if as3.y>=160 or as3.x<-20 or as3.x>190 then table.remove(aste3,k) end if as3.live <= 0 then table.remove(aste3,k) score.sc=score.sc+5 as3.explo=as3.explo-30 end if as3.explo<30 then as3.explo=as3.explo+as3.exploTime for i=1,3 do addExplosion(as3.x,as3.y) end end -- remove asteroid 3 -- collision witch bullet player for i,v in pairs(pbullet1) do if v.x <= as3.x+15 and v.x >= as3.x-15 and v.y <= as3.y+15 and v.y >= as3.y-15 and v.laser==0 then as3.live=as3.live-1 sfx(6,"C-1",-1,1,volume) table.remove(pbullet1) end end for i,v in pairs(pbullet2) do if v.x <= as3.x+15 and v.x >= as3.x-15 and v.y <= as3.y+15 and v.y >= as3.y-15 and v.laser==0 then as3.live=as3.live-1 sfx(6,"C-1",-1,1,volume) table.remove(pbullet2) end end for i,v in pairs(pbullet3) do if v.x <= as3.x+15 and v.x >= as3.x-15 and v.y <= as3.y+15 and v.y >= as3.y-15 and v.laser==0 then as3.live=as3.live-1 sfx(6,"C-1",-1,1,volume) table.remove(pbullet3) end end -- collision witch bullet player laser for i,v in pairs(pbullet1) do if v.x <= as3.x+15 and v.x >= as3.x-15 and v.y <= as3.y+15 and v.y >= as3.y-15 and v.laser==1 then as3.live=as3.live-0.2 sfx(6,"C-1",-1,1,volume) end end for i,v in pairs(pbullet2) do if v.x <= as3.x+15 and v.x >= as3.x-15 and v.y <= as3.y+15 and v.y >= as3.y-15 and v.laser==1 then as3.live=as3.live-0.2 sfx(6,"C-1",-1,1,volume) end end for i,v in pairs(pbullet3) do if v.x <= as3.x+15 and v.x >= as3.x-15 and v.y <= as3.y+15 and v.y >= as3.y-15 and v.laser==1 then as3.live=as3.live-0.2 sfx(6,"C-1",-1,1,volume) end end -- collision witch player for i,v in pairs(player) do if v.x <= as3.x+15 and v.x >= as3.x-15 and v.y <= as3.y+15 and v.y >= as3.y-15 and protect==0 then as3.live=as3.live-1 sfx(6,"C-1",-1,1,volume) protect=1 mod=mod-1 gb1=gb1-1 gb2=gb2-1 end end end end -- speed bullet pbdy=-2 pbdx=-2 -- bullet1 player1 genre 1 pbullet1={} function addPbullet1(x,y,g) local pb1={} pb1.x=x pb1.y=y pb1.dx=0 pb1.dy=0 pb1.rn=rnd(12) pb1.sp=0 pb1.laser=0 pb1.g=g pb1.t=0 table.insert(pbullet1,pb1) end function ticPbullet1() for k,pb1 in pairs(pbullet1) do pb1.t=pb1.t+1 if gBullet==3 then pb1.laser=1 end -- if pb1.g==1 then pb1.sp=256 pb1.y=pb1.y+pbdy elseif pb1.g==2 then pb1.sp=288+pb1.t%20/10 pb1.y=pb1.y+pbdy if #boss>=1 then for s,b in pairs(boss) do if pb1.x>b.x+pb1.rn then pb1.x=pb1.x+pbdx/4 elseif pb1.xm.x+pb1.rn then pb1.x=pb1.x+pbdx/4 elseif pb1.x=1 then for s,b in pairs(boss) do if pb2.x>b.x+pb2.rn then pb2.x=pb2.x+pbdx/4 elseif pb2.xm.x+pb2.rn then pb2.x=pb2.x+pbdx/4 elseif pb2.x=180 then table.remove(pbullet2,k) end end end -- bullet3 player pbullet3={} function addPbullet3(x,y,flip,g) local pb3={} pb3.x=x pb3.y=y pb3.dx=0 pb3.rn=rnd(12) pb3.sp=0 pb3.g=g pb3.t=0 pb3.laser=0 pb3.flip=flip table.insert(pbullet3,pb3) end function ticPbullet3() for k,pb3 in pairs(pbullet3) do pb3.t=pb3.t+1 if gBullet==3 then pb3.laser=1 end -- if pb3.g==1 then pb3.sp=256 pb3.y=pb3.y+pbdy elseif pb3.g==2 then pb3.sp=288+pb3.t%20/10 pb3.y=pb3.y+pbdy if #boss>=1 then for s,b in pairs(boss) do if pb3.x>b.x+pb3.rn then pb3.x=pb3.x+pbdx/4 elseif pb3.xm.x+pb3.rn then pb3.x=pb3.x+pbdx/4 elseif pb3.x=po.x-16 and p.y<=po.y+8 and p.y>=po.y-16 then table.remove(power,k) speedplayer=speedplayer+0.5 score.sc=score.sc+100 sfx(2,"D-4",-1,1,volume) end end -- power up 2 speed bullet elseif po.mod==2 then po.sprite=259 -- collision witch player for s,p in pairs(player) do if p.x<=po.x+8 and p.x>=po.x-16 and p.y<=po.y+8 and p.y>=po.y-16 then table.remove(power,k) pbdx=pbdx-0.25 pbdy=pbdy-0.25 score.sc=score.sc+100 sfx(2,"E-4",-1,1,volume) end end -- power up 3 speed spawn bullet elseif po.mod==3 then po.sprite=260 -- collision witch player for s,p in pairs(player) do if p.x<=po.x+8 and p.x>=po.x-16 and p.y<=po.y+8 and p.y>=po.y-16 then table.remove(power,k) pmaxt=pmaxt-3 score.sc=score.sc+100 sfx(2,"F-4",-1,1,volume) end end -- power up 4 mod player elseif po.mod==4 then po.sprite=261 -- collision witch player for s,p in pairs(player) do if p.x<=po.x+8 and p.x>=po.x-16 and p.y<=po.y+8 and p.y>=po.y-16 then table.remove(power,k) mod=mod+1 score.sc=score.sc+100 sfx(4,"C-4",-1,1,volume) end end -- power up 5 up genre1 bullet elseif po.mod==5 then po.sprite=262 -- collision witch player for s,p in pairs(player) do if p.x<=po.x+8 and p.x>=po.x-16 and p.y<=po.y+8 and p.y>=po.y-16 then table.remove(power,k) gb1=gb1+1 gb2=gb2-3 score.sc=score.sc+100 sfx(2,"D-2",-1,1,volume) end end -- power up 6 up genre2 bullet elseif po.mod==6 then po.sprite=263 -- collision witch player for s,p in pairs(player) do if p.x<=po.x+8 and p.x>=po.x-16 and p.y<=po.y+8 and p.y>=po.y-16 then table.remove(power,k) gb2=gb2+1 gb1=gb1-3 score.sc=score.sc+100 sfx(2,"F-1",-1,1,volume) end end -- power up 7 remove all mob elseif po.mod==7 then po.sprite=264 -- collision witch player for s,p in pairs(player) do if p.x<=po.x+8 and p.x>=po.x-16 and p.y<=po.y+8 and p.y>=po.y-16 then table.remove(power,k) for a,m in pairs(mob) do for i=1,5 do addExplosion(m.x,m.y) end end for i=1,100 do table.remove(mob) end score.sc=score.sc+100 sfx(3,"C-1",-1,1,volume) end end -- power up 8 normale bullet elseif po.mod==8 then po.sprite=265 -- collision witch player for s,p in pairs(player) do if p.x<=po.x+8 and p.x>=po.x-16 and p.y<=po.y+8 and p.y>=po.y-16 then table.remove(power,k) gBullet=1 score.sc=score.sc+100 sfx(4,"C-4",-1,1,volume) end end -- power up 9 bullet searching elseif po.mod==9 then po.sprite=266 -- collision witch player for s,p in pairs(player) do if p.x<=po.x+8 and p.x>=po.x-16 and p.y<=po.y+8 and p.y>=po.y-16 then table.remove(power,k) gBullet=2 score.sc=score.sc+100 sfx(4,"C-4",-1,1,volume) end end -- power up 10 bullet laser elseif po.mod==10 then po.sprite=267 -- collision witch player for s,p in pairs(player) do if p.x<=po.x+8 and p.x>=po.x-16 and p.y<=po.y+8 and p.y>=po.y-16 then table.remove(power,k) gBullet=3 score.sc=score.sc+100 sfx(4,"C-4",-1,1,volume) end end end -- remove power up if po.y>=170 then table.remove(power,k) end end end -- player player={} speedplayer=1 mod=1 pmaxt=40 protect=0 life=3 alive=true -- genre of bullet gb1=0 gb2=0 gBullet=1 -- function addPlayer() local p={} p.x=80 p.y=160 p.mainSpr=0 p.t=0 p.anim=0 p.animt=0 p.charge=3 p.tcharge=0 p.anil=0 p.anilTime=0 p.pt=0 p.spawn=0 table.insert(player,p) end function ticPlayer() for k,p in pairs(player) do -- Spawn player if p.spawn==0 and p.y>=90 then p.y=p.y-0.5 addParticles(p.x+8,p.y+14,2) addParticles(p.x+8,p.y+14,3) addParticles(p.x+8,p.y+14,4) else p.spawn=1 end -- controle player if p.spawn==1 then if btn(0) then p.y=p.y-speedplayer end if btn(1) then p.y=p.y+speedplayer end if btn(2) then p.x=p.x-speedplayer end if btn(3) then p.x=p.x+speedplayer end end -- shoot controle if p.anil==0 and p.spawn==1 then if btn(4) and p.t<=0 then sfx(7,"D-1",-1,1,volume) -- shoot controle genre 1 if gb1==1 then addPbullet2(p.x-5,p.y+4,0,gBullet) addPbullet2(p.x+12,p.y+4,1,gBullet) elseif gb1==2 then addPbullet2(p.x-5,p.y+2,0,gBullet) addPbullet2(p.x-5,p.y+9,0,gBullet) addPbullet2(p.x+12,p.y+2,1,gBullet) addPbullet2(p.x+12,p.y+9,1,gBullet) elseif gb1==3 then addPbullet2(p.x-5,p.y+2,0,gBullet) addPbullet2(p.x-5,p.y+6,0,gBullet) addPbullet2(p.x-5,p.y+10,0,gBullet) addPbullet2(p.x+12,p.y+2,1,gBullet) addPbullet2(p.x+12,p.y+6,1,gBullet) addPbullet2(p.x+12,p.y+10,1,gBullet) end -- shoot controle genre 2 if gb2==1 then addPbullet3(p.x-3,p.y+5,0,gBullet) addPbullet3(p.x+12,p.y+4,1,gBullet) elseif gb2==2 then addPbullet3(p.x-3,p.y+2,0,gBullet) addPbullet3(p.x-3,p.y+9,0,gBullet) addPbullet3(p.x+12,p.y+2,1,gBullet) addPbullet3(p.x+12,p.y+9,1,gBullet) elseif gb2==3 then addPbullet3(p.x-1,p.y+2,0,gBullet) addPbullet3(p.x-5,p.y+6,0,gBullet) addPbullet3(p.x-9,p.y+10,0,gBullet) addPbullet3(p.x+8,p.y+2,1,gBullet) addPbullet3(p.x+12,p.y+6,1,gBullet) addPbullet3(p.x+16,p.y+10,1,gBullet) end ---- if mod==1 then addPbullet1(p.x+5,p.y-1,gBullet) --------------- elseif p.t<=0 and mod==2 then addPbullet1(p.x+2,p.y-2,gBullet) addPbullet1(p.x+9,p.y-1,gBullet) --------------- elseif p.t<=0 and mod==3 then addPbullet1(p.x-1,p.y-2,gBullet) addPbullet1(p.x+5,p.y-3,gBullet) addPbullet1(p.x+12,p.y-1,gBullet) end p.t=pmaxt end elseif p.anil==1 then sfx(3,"D-1",-1,1,volume) p.anilTime=p.anilTime+1 if p.anilTime>=30 then addParticles(p.x+8,p.y,5) addParticles(p.x+8,p.y,6) addParticles(p.x+8,p.y,7) addPbullet1(p.x+4,p.y-3,4) end end ----------------- if p.spawn==1 then if btnp(5) and p.anil==0 and p.charge>=3 then p.charge=p.charge-3 p.anil=1 end if p.anil==1 and p.anilTime<=30 then spr(296+p.anilTime%10/5,p.x+4,p.y-2,0) end if p.anil==1 and p.anilTime>=100 then p.anil=0 p.anilTime=0 end end -- if p.t<=0 then p.t=0 elseif p.t>0 then p.t=p.t-1 end -- graphisme player if mod==1 then p.mainSpr=1 elseif mod==2 then p.mainSpr=2 elseif mod==3 then p.mainSpr=3 end -- spr(p.mainSpr,p.x,p.y,0,2) -- charge beahvior player p.tcharge=p.tcharge+1 if p.tcharge>=500 and p.charge<=2 then p.tcharge=0 p.charge=p.charge+1 elseif p.tcharge>=500 and p.charge>=3 then p.tcharge=500 end -- if p.spawn==1 then if p.x>=160 and p.charge==0 then p.x=160 elseif p.x>=160 and p.charge>=1 and btnp(3) then p.x=1 p.charge=p.charge-1 p.anim=1 p.animt=0 sfx(6,"C-1",-1,1,volume) elseif p.x>=160 and p.charge>=1 then p.x=160 end if p.x<=0 and p.charge==0 and p.spawn==1 then p.x=0 elseif p.x<=0 and p.charge>=1 and btnp(2) then p.x=159 p.charge=p.charge-1 p.anim=1 p.animt=0 sfx(2,"A-2",-1,1,volume) elseif p.x<=0 and p.charge>=1 then p.x=0 end if p.y>=120 and p.charge==0 then p.y=120 elseif p.y>=120 and p.charge>=1 and btnp(1) then p.y=1 p.charge=p.charge-1 p.anim=1 p.animt=0 sfx(2,"A-2",-1,1,volume) elseif p.y>=120 and p.charge>=1 then p.y=120 end if p.y<=0 and p.charge==0 then p.y=0 elseif p.y<=0 and p.charge>=1 and btnp(0) then p.y=119 p.charge=p.charge-1 p.anim=1 p.animt=0 sfx(2,"A-2",-1,1,volume) elseif p.y<=0 and p.charge>=1 then p.y=0 end end -- graphism if p.anim==1 then p.animt=p.animt+1 spr(81+p.animt%10//3,p.x,p.y,0,2) end if p.animt>=30 then p.animt=0 p.anim=0 end -- collision witch the mobs for i,m in pairs(mob) do if m.x <= p.x+15 and m.x >= p.x-15 and m.y <= p.y+15 and m.y >= p.y-15 and protect==0 and m.g~=8 then m.live=m.live-1 sfx(6,"C-1",-1,1,volume) protect=1 mod=mod-1 gb1=gb1-1 gb2=gb2-1 for i=1,5 do addExplosion(p.x+5,p.y+5) end --print("collisionn",p.x,p.y) elseif m.x <= p.x+15 and m.x >= p.x-15 and m.y <= p.y+15 and m.y >= p.y-25 and protect==0 and m.g==8 then m.live=m.live-1 sfx(6,"C-1",-1,1,volume) protect=1 mod=mod-1 gb1=gb1-1 gb2=gb2-1 for i=1,5 do addExplosion(p.x+5,p.y+5) end --print("collision",p.x,p.y) end end -- collision witch boss for i,b in pairs(boss) do if b.x <= p.x+15 and b.x >= p.x-25 and b.y <= p.y+15 and b.y >= p.y-25 and protect==0 then b.live=b.live-1 sfx(6,"C-1",-1,1,volume) protect=1 mod=mod-1 gb1=gb1-1 gb2=gb2-1 for i=1,5 do addExplosion(p.x+5,p.y+5) end end end -- protect player if he take damage -- and remove player if btn(7) and p.charge>=2 and protect==0 and p.spawn==1 then p.charge=p.charge-2 protect=1 end if p.pt<=150 and protect==1 and mod>=1 then circb(p.x+7.5,p.y+8,10,4) p.pt=p.pt+1 elseif p.pt>150 then p.pt=0 protect=0 end if mod<=0 and life>=1 then mod=0 for i=1,15 do addExplosion(p.x,p.y) end life=life-1 alive=false music(4,-1,-1,false) table.remove(player,k) elseif mod<=0 and life<=0 then mod=0 for i=1,15 do addExplosion(p.x,p.y) end life=life-1 alive=false music(3,-1,-1,false) table.remove(player,k) end -- end ticPbullet1() ticPbullet2() ticPbullet3() end -- draw state player --score score={ sc=0; hisc=10000; re=10000; ll=0 } -- function drawStatPlayer() rect(175,0,65,136,0) rectb(175,0,65,136,1) -- print("Score:",180,2,12) print(""..score.sc,185,12,12) -- print("Hing Score:",180,22,12) print(""..score.hisc,185,32,12) -- charge player for s,p in pairs(player) do rect(180,80,p.tcharge/9.20,5,10) rectb(180,80,55,5,9) print("Charge x "..p.charge,180,70,8) end -- if score.sc>=score.hisc then score.hisc=score.sc end end -- draw scroling vertical svc=0 svp=0 function scrolingVertical() svc=svc+1 svp=svp+1 -- ticPix() ticCir() -- if svc>=20 then svc=0 addCir() end if svp>=3 then svp=0 addPix() end end -- draw ennemies mt=6 -- mtx=0 mty=0 -- sps=0 -- admo=0 function drawMob() mtx=rnd(10,160) mty=-70 -- ticMob() ticBulletMob() ticBoss() ticAste1() end -- draw power up powert=0 powerx=0 function powerUp() ticPower() powert=powert+1 powerx=rnd(170) -- if powert>1000 and transi==0 then powert=0 addPower(powerx,-10) end -- beavhior if speedplayer>=4 then speedplayer=4 end if mod>=3 then mod=3 end if pmaxt<=10 then pmaxt=10 end if pbdx<=-7 then pbdx=-7 end if pbdy<=-7 then pbdy=-7 end -- genre of bullet if gb1>=3 then gb1=3 elseif gb1<=0 then gb1=0 end if gb2>=3 then gb2=3 elseif gb2<=0 then gb2=0 end end -- draw player spawnP=0 function drawPlayer() ticPlayer() -- if spawnP==0 then spawnP=1 addPlayer() end end -- draw transition level tra=0 trat=0 transi=0 function drawTransi() trat=trat+1 if trat>=200 and trat<=600 then print("Level "..level,60,60,12,1,2,2) end if trat>=400 and tra==0 then tra=1 level=level+1 end -- end if trat>600 then tra=0 trat=0 transi=0 end end -- draw level level=-1 pause=0 -- for add asteroid atime=0 ate=0 function drawLevel() -- start level if level==-1 and pause==0 then level=0 end -- beavhior level if level>=0 and pause==0 then drawMob() ticExplosion() drawPlayer() powerUp() end -- if #mob<=0 and #boss<=0 and #aste1<=0 and #aste2<=0 and #aste3<=0 and level>=0 and pause==0 and transi==0 and alive==true then admo=0 mt=mt+1 transi=1 atime=0 ate=0 end -- transition level if transi==1 then drawTransi() elseif transi==0 and level>=1 then print("Level "..level,70,130,12) end -- level add if level>=0 and admo==0 and alive==true and transi==0 and level~=3 and level~=6 and level~=8 and level~=10 and level~=12 and level~=15 and level~=17 and level~=20 and level~=24 and level~=25 and level~=26 then admo=1 for i=1,mt do addMob(mtx,mty-mt*5) end end -- level fin if level==26 and admo==0 and transi==0 and alive==true then mod=0 life=0 end -- level bonus -- level 3 if level==3 and admo==0 and transi==0 and alive==true then admo=1 addAste1(60,-20,1) end if level==3 and admo==1 and transi==0 and ate<3000 and alive==true then atime=atime+1 ate=ate+1 if atime>=30 then atime=0 addAste1(60,-20,1) end end -- level 8 if level==8 and admo==0 and transi==0 and alive==true then admo=1 addAste1(60,-20,1) end if level==8 and admo==1 and transi==0 and ate<3000 and alive==true then atime=atime+1 ate=ate+1 if atime>=30 then atime=0 addAste1(60,-20,1) end end -- level 12 if level==12 and admo==0 and transi==0 and alive==true then admo=1 addAste1(60,-20,1) end if level==12 and admo==1 and transi==0 and ate<3000 and alive==true then atime=atime+1 ate=ate+1 if atime>=30 then atime=0 addAste1(60,-20,1) end end -- level 17 if level==17 and admo==0 and transi==0 and alive==true then admo=1 addAste1(60,-20,1) end if level==17 and admo==1 and transi==0 and ate<3000 and alive==true then atime=atime+1 ate=ate+1 if atime>=30 then atime=0 addAste1(60,-20,1) end end -- level 24 if level==24 and admo==0 and transi==0 and alive==true then admo=1 addAste1(60,-20,1) end if level==24 and admo==1 and transi==0 and ate<3000 and alive==true then atime=atime+1 ate=ate+1 if atime>=30 then atime=0 addAste1(60,-20,1) end end -- level Boss -- level 6 if level==6 and admo==0 and transi==0 and alive==true then admo=1 addBoss(1) end -- level 10 if level==10 and admo==0 and transi==0 and alive==true then admo=1 addBoss(2) end -- level 15 if level==15 and admo==0 and transi==0 and alive==true then admo=1 addBoss(3) end -- level 20 if level==20 and admo==0 and transi==0 and alive==true then admo=1 addBoss(4) end -- level 25 if level==25 and admo==0 and transi==0 and alive==true then admo=1 addBoss(5) end -- if pause==0 and level>=1 and btnp(6) then pause=1 music(1,-1,-1,false,2) zero=Pause end end -- function Pause() -- pause if pause==0 and level>=1 and btnp(6) then pause=1 music(1,-1,-1,false) elseif pause==1 and btnp(6) then pause=0 music(0,-1,-1,false) zero=start end if pause==1 then rect(38,58,100,30,1) rectb(38,58,100,30,8) print("pause",50,60,12,2,4,1) end end -- x=88 y=34 mpl=false function zero() cls() zero=drawEarth end backIntro=0 function menu() -- return to intro if not mpl then music(6,-1,-1,true,true) mpl=true end backIntro=backIntro+1 if btn()~=0 then backIntro=0 end if backIntro>=4000 then backIntro=0 zero=drawEarth mpl=false end -- if btnp(0) then y=y-10 end if btnp(1) then y=y+10 end if y <= 34 then y = 34 elseif y >= 64 then y = 64 end if y == 34 and btnp(5) then zero=start mpl=false music(-1) end if y == 44 and btnp(5) then zero=option mpl=false music(-1) end if y == 54 and btnp(5) then zero=about mpl=false music(-1) end if y == 64 and btnp(5) then exit() end cls(13) map(0,0,30,17) spr(248,15,5,0,3,0,0,8,1) spr(5,x-2,y-2,0,1,0,1) -- print("Score:",10,120,12) print(""..score.sc,25,130,12) -- print("Hing Score:",160,120,12) print(""..pmem(0),175,130,12) -- print(text.t2,96,34,12) print(text.t3,96,44,12) print(text.t4,96,54,12) print(text.t5,96,64,12) end -- tgo=0 tdie=0 tlife=life function NoAlive() cls(0) if life<0 then print("Game Over",50,60,12,2,4,1) elseif life>=0 then spr(1,85,35,0,3) if tdie==150 then tlife=tlife-1 end print(" x "..tlife,104,45,12,2,2) end -- tdie=tdie+1 if tdie>=250 and life<0 and level~=26 then spawnP=0 speedplayer=1 mod=1 pmaxt=40 protect=0 gb1=0 gb2=0 tgo=0 tdie=0 level=0 life=3 tlife=life score.sc=0 score.ll=0 alive=true zero=menu gBullet=1 mt=6 elseif tdie>=250 and life<0 and level==26 then spawnP=0 speedplayer=1 mod=1 pmaxt=40 protect=0 gb1=0 gb2=0 tgo=0 tdie=0 level=0 life=3 tlife=life score.sc=0 score.ll=0 alive=true zero=Thanks gBullet=1 mt=6 elseif tdie>=250 and life>=0 then spawnP=0 speedplayer=1 mod=1 pmaxt=40 protect=0 gb1=0 gb2=0 tgo=0 tdie=0 level=level-1 mt=mt-1 alive=true zero=start end end -- function start() cls() scrolingVertical() drawLevel() drawStatPlayer() -- if mod<=0 then rect(350+tgo,-10,300,160,0) rect(350+tgo,-10,300,160,0) tgo=tgo-1 end if tgo<=-351 then table.remove(mob) table.remove(bulletMob) table.remove(boss) table.remove(power) table.remove(aste1) table.remove(aste2) table.remove(aste3) end if tgo<=-380 then admo=0 atime=0 ate=0 zero=NoAlive end end -- arrowV=0 function option() cls() -- graphisme rect(70,50,volume*10,5,12) rectb(70,50,90,5,8) rect(70,70,volumeM*10,5,12) rectb(70,70,90,5,8) -- beavhior if btnp(0) then arrowV=arrowV-1 elseif btnp(1) then arrowV=arrowV+1 end if arrowV<=0 then arrowV=0 elseif arrowV>=2 then arrowV=2 end if arrowV==0 and btnp(2) then volume=volume-1 sfx(1,"E-4",-1,1,volume) elseif arrowV==0 and btnp(3) then volume=volume+1 sfx(1,"E-5",-1,1,volume) end if arrowV==1 and btnp(2) then volumeM=volumeM-1 elseif arrowV==1 and btnp(3) then volumeM=volumeM+1 end if arrowV==2 and btnp(2) then language=0 elseif arrowV==2 and btnp(3) then language=1 end -- if arrowV==0 then circ(62,52,3,12) elseif arrowV==1 then circ(62,72,3,12) elseif arrowV==2 then circ(62,92,3,12) end -- language if language==0 then print("Francais",70,92,12) print("Anglais",128,92,13) elseif language==1 then print("Francais",70,92,13) print("Anglais",128,92,12) end -- sound if volume<=0 then volume=0 elseif volume>=9 then volume=9 end if volumeM<=0 then volumeM=0 elseif volumeM>=9 then volumeM=9 end if btnp(5) then zero=menu end -- graphisme print("Sfx",165,50,4) print("Music",165,70,9) print(text.t1,70,80,12) end endd=0 function Thanks() endd=endd+1 if not mpl then music(7,-1,-1,false,true) mpl=true end print("Hings Score "..score.hisc,15,40,endd,0,2) if endd>=400 then print(text.t25,70,90,12,4) if btn()~=0 then spawnP=0 speedplayer=1 mod=1 pmaxt=40 protect=0 gb1=0 gb2=0 tgo=0 tdie=0 level=0 life=3 tlife=life score.sc=0 score.ll=0 alive=true zero=menu gBullet=1 mt=6 endd=0 zero=menu mpl=false end end print(text.t24,59,110,12,0,1) end -- function about() cls() print("A game by",60,10,12,8,2) print("OdiStudio Games",30,30,12,8,2) print("odistudio4444@gmail.com",115,130) print("Copyright (c) 2023",2,130) if btnp(5) then zero=menu end end ---- --save score if pmem(0)==nil then pmem(0,0) end --- function TIC() zero() if language==0 then text=text1 elseif language==1 then text=text2 end if score.ll==0 and score.sc>=10000 then score.ll=1 life=life+1 sfx(3,"C-3",-1,1,volume) end -- save if score.sc>pmem(0) then pmem(1,pmem(0)) pmem(0,score.hisc) end end