0 D$404mNJqL<e0FHuqY}},0Ҫm^ 2TvͫgE#2Tv2TvUfffffU4ͻljj"TwwfE=ü"CTf8CTv2TvuxgVEDTUf3DD33DD3UUWWVVED"xw [[[UU[[PUU :33:33:033DDDNN@N@NNDNDD/!//!!!!zzzwwwwwwzzwwwzzwwwwwwzwwwzzzwwwwwww23zwS;Sw3[wwww3#5wS35zzzwwwwwwzzAzwI;w9wwwwwDJt:s:s`fffaffaffaffaffafaff :3333::033DDD@@@@DDDDDDDDDDDDD@N@@@@@NDDzwwwzzwwzzzzwzwwzzzzzzwzwwwzSSw3Szw23zzzwzwwzzzzz55;w33#wwwzwc6w4zDzwAzzwzwwzzzzz:fs:IsJIDwwwww IIIDIII@DD :::3:::033DD:::::4:3:3:3:3:3DD733337333ss37333373333033330333ss3(((((( "" :3::033D4:::::D:3:3:3:3:3733337333ss37333373333033330333ss333CDJND433N᮪33333333333::::::::::::::::C:J::::::DND::::::O:J::3:3:3:3:3DNDCD33JN3333D43N3CD33JN33`fffafff`fffafff`fffafff`fffafffffffffffffffffffffffffff33D43N3J333333䪪3333᮪333N33333333333:3:::::::::::J::C::::::::::NDN:::::::J:O:::::NDN:3:3:3:3:3:3J:3333333333ᮣ3303N3303333:3J:333333333`fffafff`fffafff`fffafff`fffafffffffffffffffffffffffffff3ᮣ3303N3303333:333333333333:3:3:3:3:3:3:3:3wwwwwwwwwwwwwwww3333J3333N᮪33333J:3:303333N3ᮣffffffffffffffffffffffff303333N3ᮣ33333J:3:`fffafff`fffafff`fffafff`fffafff:333:3:::33333333333333333:3:33333333333333wwwwwwww3333wwwwwwww333333333333䪪JD᮪>33133133433D33333JD:303>3103134Dffffffffffffffffffffffff303>3103134D33333JD:`fffafff`fffafff`fffafff`fffafff:3:3:3:3:3:3:3:33:aaffffffffaa3333aaffffffffaa3333affffffaa3333:wAzwDD{DDuDDuA{AuAuwwApDDpWDDpWDDpApWApWAaafffafffaa3333UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU5wUUuwUUuUUuUUuUUuUUuUUuNNNNDDDDNNNNDDDD[[[[UUUU[[[[UUUU:3:3:33:333333333333333333333333333((((""""3333((((""""3333((""(((""""3333:uA{uu{sw333w:3pWpApWpWpw7w3333"("((""""3333UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUuUUuUUuUUuUUuUUuwUU5wUU53aaffffffffaaaaffffffffaa((((""""((((""""3333UfDQaDUfA3333affffffaa3333 A DDUDDDDUA AEAUUUUUUUUs'  UUUUUUUUUUUUUUUUUUUUUUUUz7rppUUUU5: UUUUUUUUUUUUp0   0000 ?/ 0303?3((""(((""""3333:UA UU33 'swww33335333UUUUUUUUUUUUw33333333UUUUUUUUUUUUzw33333333UUUUUUUUUUUUprwww73333333SUUUUUUUUUUUUwwwwwwwwDDwwwwwwwwDwwwwwwwwNDNDNwwwwwwwwNwwwwwwwwNwwwwwwwwNNNNffff``fa`fwwwwwwww3333af````aaf````wwwwwwww3333f``fa`fwwwwwwww3333ffffwwwwwwww3333ffa`wwwwwwww3333faf`wwwwwwww3333:5UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUD@ṻྻᄏݻ ݻ؍ݻ"ݻ ݻҸнݽݸ000?00000黻黻黻黻黻ᄏᄏᄏﹻﹻﹻݍظؿݍ݈؈omfffݻ߽ظ߸߸߽߸ݻؽ뙻뻻黻ﹻﹻۈۻ݈ݍ݋ݻݻػݽߍ߸߸+""w+wrww""""rw""""wwwwrrrw"w'wﹻ)"ywwwwww'''wrw""w"wwww'"""w'""""+""w+wrww""""rw""""؍݇wwwwrrrw"w'w߸("xݍݍwwwwww'''wrw""w"wwww'"""w'""""`a@A@A@A@A@A@AHI@A@A@A@A@A@ABCpqPQPQPQPQPQPQXYPQPQPQPQPQPQRS"#      &'     DE2367TU"#     &'     DE2367TU"#ņDE23ՖTU$%     &'      FG4567VW$%    &'     FG4567VW$%     &'     FG$4567VW4fgfgfgfgfgfghifgfgfgfgfgfgcvwvwvwvwvwvwxyvwvwvwvwvwvwrs U      ',..//////////////////////////      @ @ ABCCDDEFGHIIJKLLMMMOOOOOOOOOGLNNOOOOOOOOOOOOOOOOOOOOOOOOOO  CD E FFGGHHJIIIJJJKKKLLLLLLLLMOO            g ``````d d d d d d d ddddd d d dd  ?f!"""""""""""""!""""""""""""""ff!"""""""""""""!"""""""""""fsz7""""""""""""!"""""""""""sz7'r!"""""""""""!"""""""""""'r !"""""""""""DDD""""""""""  """"""""""NDDD"""""""""" ""p!"""""""""NDN$"""""""""p""""p!"""""""NNDDD$"""""p""""p""""""NNN$"""""p"""""'r!"""NDNNDDD""'r"""""swwwwzwwww7DDDDDDNN$BDswwwwzwwww7"""""3333333333333333DNNDD3333333333333333"""""233333333333333ADDND133333333333333"""""""NDAD"""""""DDDDD"""""""D"""""""ADDD""""""""DD"""""""""""N""""""""""""""DDD!"""!"""""""""""""!""""""""""""""""!"/"/"""""""""""""""""""!"/""""""""""""""""""""""""""""""""""""!"""""""""!"""/""!"""""""""""""""""!""""""""""!"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""!"""""""!""""""""""""""""""""""""""""!"""""""""!""""""""""""""""""""""""""""""""""""""!""""""""""""""""""""""""""""1wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww#""""""""""""""""""""""""""qwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww'""""""""""NNNNNNNNNNNNNNN~p'""""""""""~p'""""""""""~ p'"""""""""NNNNNNNNNNNNNNNtp'"""""""""DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDt p'"""""""""!""""""""qp""""""""aaaaaaaaaaaaaaav p""""""""ffffffffffffffffffffffffffffffvp""""""ffffffffffffffffffffffffffffffvp!"""""aaaaaaaaaaaaaaaqp!"""qpqwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww1wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww133333333333333333333333333333333333333333333333333333333331wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwqwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww[[[[[[[[[[[[[[[{p{p{ p[[[[[[[[[[[[[[[up"""UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUu p!""""""qp"""""""(((((((((((((((x  p"""""""""xp!""""""""""xp"""""""""""(((((((((((((((rp"""""""""""""""""""""""""""""""""""""""""rp!""""""""""""qwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww"""""""""""""1wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww"""""""""""""!"13333333333333333333333333333333333333333333333333333333333"""""""""""""""!"""""""!""""""""""""""!"""!"""""""""!""""""""""""""!"""""""""""""!""""""""""""""!"""!"""""""""""!""""""""""""""""!"""""""""""!""""""""""""""1#"""""""*""""""":*"""""" *""""""p*""""""p*""""""p*"""""p*"""""p*"""""p*""""p*"""p*"""p*"pppppNNNNNNNp""p""""pJNNNNNNN""""pJDDDDDDDDDDDDDD"""""p""""""pjaaaaaaa""""""pjffffffffffffff""""""pjffffffffffffff"""""""paaaaaaa"""""""p"""""""p"""""""p""""""""p""""""""p"""""""""p!""""""""""p"""""""""""p"""""""""""p"""""""""""p!"""""""""p""""""""p"""""""p"""""""p""""""p""""""p""""""p"""""p""""fffp""""`f(p""afa(p`f(pafa(p`f(pfff(p ""pppppp:1!"""""""""""""""""""""!"""""""""!""""""""""""""""!""""""!"""""""""""""""""""!""""""""""vt-- title: Super Word Scrambler !!! -- author: DaGreenGem -- desc: guess the scrambled word ! -- script: lua -- Note : This is a small game, its code could -- be far more optimized. Incase you're looking -- for tips to optimize your code, this probably -- isn't what you should be looking for. -- > Using the small font will make things easier -- to read :) t=0 x=96 y=24 state=0 timer=0 mainmenuselect=0 optionsselect=0 roundsetupselect=0 selallow=0 volume=15 loadingtype = 0 numrounds=5 --1-10 attround=5 --1-99 attempts=10 p1score=0 p2score=0 gamestate=0 round=1 gmcursorx=0 gmcursory=0 word="" guess="" realword="" colseed=0 p1tempscore=0 p2tempscore=0 wordlimit=19 p1gonly=0 sparklex=0 sparkley=0 sparklet=0 smoke = {} smokeactive=0 for i=0,5 do smoke[i] = {} smoke[i][0] = 120 -- x pos smoke[i][1] = math.random(0,136) -- y pos smoke[i][2] = 0 -- time smoke[i][3] = math.random()*2*3.1415 -- seed (0-2pi) smoke[i][4] = math.random()/1.5 end -- state 0 : Main Menu 1st state -- state 1 : Main Menu 2nd state -- state 2 : Main Menu 3rd state -- state 3 : Options -- state 4 : Transition -- state 5 : Round Set-up -- state 6 : Game -- state 7 : Game Over -- Tool Functions function outlineprint(text,x,y,colin,colout) print(text,x-1,y+1,colout) print(text,x,y+1,colout) print(text,x+1,y+1,colout) print(text,x-1,y,colout) print(text,x+1,y,colout) print(text,x-1,y-1,colout) print(text,x,y-1,colout) print(text,x+1,y-1,colout) print(text,x,y,colin) end function waveprint(text,x,y,col,height) for i=1,string.len(text) do print(string.sub(text,i,i),x+6*(i-1),y+height*math.cos((t+i*8)/20),col) end end function colprint(text,x,y,seed) for i=1,string.len(text) do print(string.sub(text,i,i),x+(i-1)*6,y,8+(i*seed)%8) end end function waveoutlineprint(text,x,y,colin,colout,height) for i=1,string.len(text) do outlineprint(string.sub(text,i,i),x+6*(i-1),y+height*math.cos((t+i*8)/20),colin,colout) end end function numberclamp(number,min,max) if max < min then min, max = max, min end if number > max then return max elseif number < min then return min else return number end end function loadinganim(timee) -- left side of the loading gate spr(96,-math.atan(timee/30)*120,0,-1,1,0,0,2,2) spr(34,-math.atan(timee/30)*120,16,-1,1,0,0,2,2) spr(34,-math.atan(timee/30)*120,32,-1,1,0,0,2,2) spr(34,-math.atan(timee/30)*120,48,-1,1,0,0,2,2) spr(36,-math.atan(timee/30)*120,64,-1,1,0,0,2,2) spr(36,-math.atan(timee/30)*120,80,-1,1,0,0,2,2) spr(36,-math.atan(timee/30)*120,96,-1,1,0,0,2,2) spr(128,-math.atan(timee/30)*120,112,-1,1,0,0,2,2) for i=1,6 do spr(102,16*i-math.atan(timee/30)*120,112,-1,1,0,0,2,2) end for i=1,6 do spr(64,i*16-math.atan(timee/30)*120,0,-1,1,0,0,2,2) end for i=1,6 do for j=1,6 do spr(8,i*16-math.atan(timee/30)*120,j*16,-1,1,0,0,2,2) end end spr(12,16-math.atan(timee/30)*120,16,-1,1,0,0,2,2) spr(12,32-math.atan(timee/30)*120,16*5,-1,1,0,0,2,2) spr(12,16*4-math.atan(timee/30)*120,16*5,-1,1,0,0,2,2) spr(10,16*3-math.atan(timee/30)*120,32,-1,1,0,0,2,2) spr(10,16*5-math.atan(timee/30)*120,64,-1,1,0,0,2,2) spr(10,32-math.atan(timee/30)*120,96,-1,1,0,0,2,2) spr(74,7*16-math.atan(timee/30)*120,0,6,1,0,0,2,2) spr(108,7*16-math.atan(timee/30)*120,112,6,1,0,0,2,2) for i=0,30 do spr(160,i*8,128+math.atan(timee/70)*10) end for i=1,6 do spr(40,16*7-math.atan(timee/30)*120,16*i,0,1,0,0,2,2) end for i=1,4 do spr(130,i*16-math.atan(timee/30)*120,48,-1,1,0,0,2,2) end spr(164,5*16-math.atan(timee/30)*120,48,0,1,0,0,2,2) -- Right Side of the loading gate spr(66,14*16+math.atan(timee/30)*120,0,-1,1,0,0,2,2) spr(68,14*16+math.atan(timee/30)*120,16,-1,1,0,0,2,2) spr(68,14*16+math.atan(timee/30)*120,32,-1,1,0,0,2,2) spr(68,14*16+math.atan(timee/30)*120,48,-1,1,0,0,2,2) spr(70,14*16+math.atan(timee/30)*120,64,-1,1,0,0,2,2) spr(70,14*16+math.atan(timee/30)*120,80,-1,1,0,0,2,2) spr(70,14*16+math.atan(timee/30)*120,96,-1,1,0,0,2,2) spr(98,14*16+math.atan(timee/30)*120,112,-1,1,0,0,2,2) spr(66,14*16+math.atan(timee/30)*120,0,-1,1,0,0,2,2) for i=8,13 do spr(64,i*16+math.atan(timee/30)*120,0,-1,1,0,0,2,2) end for i=8,13 do spr(102,16*i+math.atan(timee/30)*120,112,-1,1,0,0,2,2) end spr(76,7*16+math.atan(timee/30)*120,0,6,1,0,0,2,2) spr(106,7*16+math.atan(timee/30)*120,112,6,1,0,0,2,2) for i=8,13 do for j=1,6 do spr(8,i*16+math.atan(timee/30)*120,j*16,-1,1,0,0,2,2) end end for i=1,6 do spr(42,16*7+math.atan(timee/30)*120,i*16,0,1,0,0,2,2) end spr(12,16*11+math.atan(timee/30)*120,16,-1,1,0,0,2,2) spr(12,16*9+math.atan(timee/30)*120,16*6,-1,1,0,0,2,2) spr(10,16*9+math.atan(timee/30)*120,32,-1,1,0,0,2,2) spr(10,16*11+math.atan(timee/30)*120,80,-1,1,0,0,2,2) spr(192,16*6+math.atan(timee/30)*120,48,-1,1,0,0,2,2) spr(136,16*5+math.atan(timee/30)*120,48,5,1,0,0,2,2) spr(194,16*7+math.atan(timee/30)*120,48,-1,1,0,0,2,2) spr(196,16*8+math.atan(timee/30)*120,48,-1,1,0,0,2,2) spr(134,16*9+math.atan(timee/30)*120,48,-1,1,0,0,2,2) for i=10,13 do spr(130,i*16+math.atan(timee/30)*120,48,-1,1,0,0,2,2) end end function keyboarddisplay() for i=0,3 do spr(138,196+i*16,82,0,1,0,0,2,2) end spr(170,20,66,5,1,0,0,2,2) for i=1,10 do spr(174,20+i*16,66,5,1,0,0,2,2) end spr(170,196,66,5,1,1,0,2,2) for j=0,1 do spr(202,20,82+j*16,5,1,0,0,2,2) for i=1,10 do spr(204,20+i*16,82+j*16,5,1,0,0,2,2) end spr(202,196,82+j*16,5,1,1,0,2,2) end spr(234,20,82+2*16,5,1,0,0,2,2) for i=1,10 do spr(236,20+i*16,82+2*16,5,1,0,0,2,2) end spr(234,196,82+2*16,5,1,1,0,2,2) print("A B C D E F G H I J K L M N O",29,73,14,true) print("P Q R S T U V W X Y Z ! ? . 0",29,83,14,true) print("1 2 3 4 5 6 7 8 9 _",29,93,14,true) print(" Backspace Done",29,113,14) spr(16,29,112,0) spr(48,160,112,0) spr(172,27+gmcursorx*12,71+gmcursory*10,0,1,0,0,2,2) end function scramble(text) -- scrambles the letters in the text for i=0,10 do mys1=math.random(1,string.len(text)) mys2=math.random(1,string.len(text)) text=string.reverse(text) text=letterswitch(text,mys1,mys2) end return text end function letterswitch(text,i,j) --swaps ith letter with jth letter if i>j then return (string.sub(text,1,j-1)..string.sub(text,i,i)..string.sub(text,j+1,i-1)..string.sub(text,j,j)..string.sub(text,i+1,string.len(text))) elseif i (math.floor(num)+1-num) then return (math.floor(num)+1) else return math.floor(num) end end function sparkle() if sparklet == 0 then sparklet=50 sparklex=math.random(95,130) sparkley=math.random(85,120) else sparklet = sparklet - 1 end spr(264+roundnum(sparklet/10),sparklex,sparkley,0) end function smokeanim() for i=0,5 do smoke[i][0] = smoke[i][0] + smoke[i][4]*math.cos(smoke[i][3]) smoke[i][1] = smoke[i][1] + smoke[i][4]*math.sin(smoke[i][3]) if smoke[i][2] > 0 then smoke[i][2] = smoke[i][2] -1 spr(179-roundnum(smoke[i][2]/40),smoke[i][0],smoke[i][1],0) elseif smokeactive == 1 then smoke[i][2] = 50 smoke[i][0] = 120 smoke[i][1] = math.random(0,136) smoke[i][3] = math.random()*2*3.1415 end end end -- Main Function function TIC() t=t+1 if timer > 0 then timer = timer - 1 end if selallow > 0 then selallow = selallow - 1 end --Ref for P1 inputs --btn(0) up --btn(1) down --btn(2) left --btn(3) right cls(1) for i=0,5 do circ((((t+(i+0.5)*185)/4)%280)-20,math.cos((t/40)+(i+0.5)*1.047)*10-10,math.abs(15*math.sin(t/80+(i+0.5)*1.047)),2) circ((((t+i*185)/4)%280)-20,math.cos((t/40)+i*1.047)*10+30,math.abs(15*math.cos(t/80+i*1.047)),2) circ((((t+(i+0.5)*185)/4)%280)-20,math.cos((t/40)+(i+0.5)*1.047)*10+70,math.abs(15*math.sin(t/80+(i+0.5)*1.047)),2) circ((((t+i*185)/4)%280)-20,math.cos((t/40)+i*1.047)*10+110,math.abs(15*math.cos(t/80+i*1.047)),2) circ((((t+(i+0.5)*185)/4)%280)-20,math.cos((t/40)+(i+0.5)*1.047)*10+150,math.abs(15*math.sin(t/80+(i+0.5)*1.047)),2) end if state < 2 then waveoutlineprint("SUPER WORD SCRAMBLER !!",57,10,14,4,5) print("Remade by DaGreenGem",10,115+(state*(timer-80)^2)/4,4) print("Original : Crypto-Logic! on Odyssey II",10,125+(state*(timer-80)^2)/4,4) end if state == 0 then print("Press A !",95,60,14,true) elseif state == 1 then colprint("Press A !",95,60,(t/100)%16) elseif state == 2 then waveoutlineprint("SUPER WORD SCRAMBLER !!",57,10,14,4,5) if mainmenuselect == 0 then spr(2,10,49,0,1) outlineprint("Play",20,50,14,4) print("Options",20,70,14) else spr(2,10,69,0,1) print("Play",20,50,14) outlineprint("Options",20,70,14,4) end print("Select",200,125+timer^2) spr(0,189,124+timer^2,0) end if state == 0 and btn(4) then state = 1 timer = 80 sfx(6,'C-5',-1,0,volume) elseif timer == 0 and state == 1 then state = 2 timer = 40 mainmenuselect = 0 elseif state == 2 then if selallow == 0 then if btn(0) then if mainmenuselect == 1 then sfx(4,'D-2',-1,0,volume) end mainmenuselect = 0 selallow = 10 elseif btn(1) then if mainmenuselect == 0 then sfx(4,'D-2',-1,0,volume) end mainmenuselect = 1 selallow = 10 end end if btn(4) and timer == 0 then if mainmenuselect==0 then state = 4 timer = 330 loadingtype = 0 else state = 3 timer = 10 optionsselect = 0 sfx(6,'C-5',-1,0,volume) end end elseif state == 3 then -- Options if selallow == 0 then if btn(0) then if optionsselect ~= numberclamp(optionsselect-1,0,2) then sfx(4,'D-2',-1,0,volume) end optionsselect = numberclamp(optionsselect-1,0,2) selallow = 10 elseif btn(1) then if optionsselect ~= numberclamp(optionsselect+1,0,2) then sfx(4,'D-2',-1,0,volume) end optionsselect = numberclamp(optionsselect+1,0,2) selallow = 10 elseif btn(2) and optionsselect == 0 then volume = numberclamp(volume-1,0,15) sfx(5,'D-2',-1,0,volume) selallow = 5 elseif btn(3) and optionsselect == 0 then volume = numberclamp(volume+1,0,15) sfx(5,'D-2',-1,0,volume) selallow = 5 elseif (btn(2) or btn(3)) and optionsselect == 1 then p1gonly = 1 - p1gonly sfx(5,'D-2',-1,0,volume) selallow = 10 end end waveoutlineprint("SUPER WORD SCRAMBLER !!",57,10,15,10,5) print("Select",200,125+timer^2) spr(0,189,124+timer^2,0) outlineprint("Options",15-timer^2,40,15,10) if optionsselect == 0 then spr(2,10,49,0,1) outlineprint("Sounds",20-timer^2,50,14,4) print("P1 Gamepad Only",20-timer^2,70,14) print("Back",20-timer^2,90,14) if p1gonly == 0 then print("OFF",180+timer^2,70,14) else print("ON",180+timer^2,70,14) end elseif optionsselect == 1 then spr(2,10,69,0,1) print("Sounds",20-timer^2,50,14) outlineprint("P1 Gamepad Only",20-timer^2,70,14,4) print("Back",20-timer^2,90,14) if p1gonly == 0 then outlineprint("OFF",180+timer^2,70,14,4) else outlineprint("ON",180+timer^2,70,14,4) end elseif optionsselect == 2 then spr(2,10,89,0,1) print("Sounds",20-timer^2,50,14) print("P1 Gamepad Only",20-timer^2,70,14) outlineprint("Back",20-timer^2,90,14,4) if p1gonly == 0 then print("OFF",180+timer^2,70,14) else print("ON",180+timer^2,70,14) end end spr(18,160-timer^2,49,0,1) spr(19,168-timer^2,49,0,1) spr(19,176-timer^2,49,0,1) spr(19,184-timer^2,49,0,1) spr(18,192-timer^2,49,0,1,1) spr(20,160-timer^2+volume*2+1,49,0,1) print("(c) 1978 Magnavox",10,115,4) print("(c) 2021 DaGreenGem",10,125,4) if btn(4) and timer == 0 then if optionsselect == 0 then sfx(0,10+t%40,-1,0,volume) elseif optionsselect == 2 then state=2 timer=10 sfx(6,'C-5',-1,0,volume) end end elseif state == 4 then -- Intro if timer > 260 then --Loading-Phase 1 if timer > 300 then sfx(1,0,-1,0,volume) end smokeactive = 0 if loadingtype == 0 then waveoutlineprint("SUPER WORD SCRAMBLER !!",57,10,14,4,5) spr(2,10,49,0,1) outlineprint("Play",20,50,14,4) print("Options",20,70,14) print("Select",200,125) spr(0,189,124,0) elseif loadingtype == 1 then waveoutlineprint("SUPER WORD SCRAMBLER !!",57,10,14,4,5) outlineprint("Round settings",15,40,14,4) spr(2,10,109,0,1) print("Number of Rounds",20,50,14) print("Attempts per Round",20,70,14) print("Word size limit",20,90,14) outlineprint("Start !",50,110,14,4) print(numrounds,180,50,14) print(attround,180,70,14) print(wordlimit,180,90,14) elseif loadingtype == 2 then spr(198,10,0,0,1,0,0,2,1) spr(166,10,0,5,1,0,0,4,2) spr(198,216,0,0,1,0,0,2,1) spr(166,198,0,5,1,0,0,4,2) print("P1",12,4,14) print(p1score,35,4,14) print("P2",200,4,14) print(p2score,223,4,14) waveoutlineprint("Game Over !",95,10,14,4,5) for i=0,3 do spr(138,i*16,30,0,1,0,0,2,2) end spr(136,3*16,30,5,1,0,0,2,2) for i=4,10 do spr(100,i*16,30,-1,1,0,0,2,2) end spr(136,11*16,30,5,1,1,0,2,2) for i=0,3 do spr(140,i*16,46,0,1,0,0,2,2) end spr(136,3*16,46,5,1,0,0,2,2) for i=4,10 do spr(100,i*16,46,-1,1,0,0,2,2) end spr(136,11*16,46,5,1,1,0,2,2) colprint("Game over ?",64,34,colseed) colprint("Game over !",64,50,colseed) if p1score > p2score then print("The winner of this game is..",50,70,15) waveprint("P1 !!",105,80,14,2) spr(260,100,90,11,1,0,0,4,4) elseif p1score < p2score then print("The winner of this game is..",50,70,15) print("P2 !!",105,80,14) spr(260,100,90,11,1,0,0,4,4) else print("Draw ! Nobody wins..",55,4+70,15) end print(" Back Again!",29,113,14) spr(16,29,112,0) spr(48,160,112,0) end loadinganim(timer-260) elseif timer > 100 and timer < 261 then smokeactive=1 --Loading-Phase 2 spr(96,0,0,-1,1,0,0,2,2) spr(34,0,16,-1,1,0,0,2,2) spr(34,0,32,-1,1,0,0,2,2) spr(34,0,48,-1,1,0,0,2,2) spr(36,0,64,-1,1,0,0,2,2) spr(36,0,80,-1,1,0,0,2,2) spr(36,0,96,-1,1,0,0,2,2) spr(128,0,112,-1,1,0,0,2,2) for i=1,6 do spr(102,16*i,112,-1,1,0,0,2,2) end spr(104,7*16,112,-1,1,0,0,2,2) for i=8,13 do spr(102,16*i,112,-1,1,0,0,2,2) end spr(98,14*16,112,-1,1,0,0,2,2) for i=0,30 do spr(160,i*8,128) end for i=1,6 do spr(64,i*16,0,-1,1,0,0,2,2) end spr(72,7*16,0,-1,1,0,0,2,2) for i=8,13 do spr(64,i*16,0,-1,1,0,0,2,2) end spr(66,14*16,0,-1,1,0,0,2,2) spr(68,14*16,16,-1,1,0,0,2,2) spr(68,14*16,32,-1,1,0,0,2,2) spr(68,14*16,48,-1,1,0,0,2,2) spr(70,14*16,64,-1,1,0,0,2,2) spr(70,14*16,80,-1,1,0,0,2,2) spr(70,14*16,96,-1,1,0,0,2,2) for i=1,13 do for j=1,6 do spr(8,i*16,j*16,-1,1,0,0,2,2) end end spr(12,16,16,-1,1,0,0,2,2) spr(12,16*11,16,-1,1,0,0,2,2) spr(12,32,16*5,-1,1,0,0,2,2) spr(12,16*4,16*5,-1,1,0,0,2,2) spr(12,16*9,16*6,-1,1,0,0,2,2) spr(10,16*3,32,-1,1,0,0,2,2) spr(10,16*9,32,-1,1,0,0,2,2) spr(10,16*5,64,-1,1,0,0,2,2) spr(10,16*11,80,-1,1,0,0,2,2) spr(10,32,96,-1,1,0,0,2,2) for i=1,13 do spr(130,i*16,48,-1,1,0,0,2,2) end for i=1,6 do spr(38,16*7,16*i,-1,1,0,0,2,2) end spr(132,16*5,48,-1,1,0,0,2,2) spr(192,16*6,48,-1,1,0,0,2,2) spr(194,16*7,48,-1,1,0,0,2,2) spr(196,16*8,48,-1,1,0,0,2,2) spr(134,16*9,48,-1,1,0,0,2,2) spr(3+(timer/5)%4,210,100,0) elseif timer < 101 then--Loading-Phase 3 smokeactive=0 if timer == 100 then sfx(2,0,-1,0,volume) end if loadingtype == 0 then waveoutlineprint("SUPER WORD SCRAMBLER !!",57,10,14,4,5) outlineprint("Round settings",15-timer^2,40,14,4) spr(2,10,49,0,1) outlineprint("Number of Rounds",20,50,14,4) print("Attempts per Round",20,70,14) print("Word size limit",20,90,14) print("Start !",50,110,14) outlineprint(numrounds,180,50,14,4) print(attround,180,70,14) print(wordlimit,180,90,14) elseif loadingtype == 1 then spr(198,10,-timer^2,0,1,0,0,2,1) spr(166,10,-timer^2,5,1,0,0,4,2) spr(198,216,-timer^2,0,1,0,0,2,1) spr(166,198,-timer^2,5,1,0,0,4,2) print("P1",12,4-timer^2,14) print(p1score,35,4-timer^2,14) print("P2",200,4-timer^2,14) print(p2score,223,4-timer^2,14) waveoutlineprint("Round "..round,95,10,14,4,5) for i=0,3 do spr(138,i*16-timer^2,30,0,1,0,0,2,2) end spr(136,3*16-timer^2,30,5,1,0,0,2,2) for i=4,10 do spr(100,i*16-timer^2,30,-1,1,0,0,2,2) end spr(136,11*16-timer^2,30,5,1,1,0,2,2) for i=0,3 do spr(140,i*16-timer^2,46,0,1,0,0,2,2) end spr(136,3*16-timer^2,46,5,1,0,0,2,2) for i=4,10 do spr(100,i*16-timer^2,46,-1,1,0,0,2,2) end spr(136,11*16-timer^2,46,5,1,1,0,2,2) elseif loadingtype == 2 then waveoutlineprint("SUPER WORD SCRAMBLER !!",57,10,14,4,5) spr(2,10,49,0,1) outlineprint("Play",20,50,14,4) print("Options",20,70,14) print("Select",200,125) spr(0,189,124,0) end loadinganim(100-timer) if timer == 0 then smokeactive=0 if loadingtype == 0 then state=5 elseif loadingtype == 1 then state=6 timer = 120 colseed=(time())%16 round=1 p1score=0 p2score=0 word="" guess="" p1tempscore=0 p2tempscore=0 gamestate=0 sfx(12,'C-4',-1,0,volume) elseif loadingtype == 2 then state = 2 end end end elseif state == 5 then if selallow == 0 then if btn(0) then if roundsetupselect ~= numberclamp(roundsetupselect-1,0,3) then sfx(4,'D-2',-1,0,volume) end roundsetupselect = numberclamp(roundsetupselect-1,0,3) selallow = 10 elseif btn(1) then if roundsetupselect ~= numberclamp(roundsetupselect+1,0,3) then sfx(4,'D-2',-1,0,volume) end roundsetupselect = numberclamp(roundsetupselect+1,0,3) selallow = 10 elseif btn(2) and roundsetupselect == 0 then numrounds = numberclamp(numrounds-1,1,10) sfx(5,'D-2',-1,0,volume) selallow = 10 elseif btn(3) and roundsetupselect == 0 then numrounds = numberclamp(numrounds+1,1,10) sfx(5,'D-2',-1,0,volume) selallow = 10 elseif btn(2) and roundsetupselect == 1 then attround = numberclamp(attround-1,1,99) sfx(5,'D-2',-1,0,volume) selallow = 10 elseif btn(3) and roundsetupselect == 1 then attround = numberclamp(attround+1,1,99) sfx(5,'D-2',-1,0,volume) selallow = 10 elseif btn(2) and roundsetupselect == 2 then wordlimit = numberclamp(wordlimit-1,2,19) sfx(5,'D-2',-1,0,volume) selallow = 10 elseif btn(3) and roundsetupselect == 2 then wordlimit = numberclamp(wordlimit+1,2,19) sfx(5,'D-2',-1,0,volume) selallow = 10 end end waveoutlineprint("SUPER WORD SCRAMBLER !!",57,10,14,4,5) outlineprint("Round settings",15-timer^2,40,14,4) if roundsetupselect == 0 then spr(2,10,49,0,1) outlineprint("Number of Rounds",20,50,14,4) print("Attempts per Round",20,70,14) print("Word size limit",20,90,14) print("Start !",50,110,14) outlineprint(numrounds,180,50,14,4) print(attround,180,70,14) print(wordlimit,180,90,14) elseif roundsetupselect == 1 then spr(2,10,69,0,1) print("Number of Rounds",20,50,14) outlineprint("Attempts per Round",20,70,14,4) print("Word size limit",20,90,14) print("Start !",50,110,14) print(numrounds,180,50,14) outlineprint(attround,180,70,14,4) print(wordlimit,180,90,14) elseif roundsetupselect == 2 then spr(2,10,89,0,1) print("Number of Rounds",20,50,14) print("Attempts per Round",20,70,14) outlineprint("Word size limit",20,90,14,4) print("Start !",50,110,14) print(numrounds,180,50,14) print(attround,180,70,14) outlineprint(wordlimit,180,90,14,4) elseif roundsetupselect == 3 then spr(2,10,109,0,1) print("Number of Rounds",20,50,14) print("Attempts per Round",20,70,14) print("Word size limit",20,90,14) outlineprint("Start !",50,110,14,4) print(numrounds,180,50,14) print(attround,180,70,14) print(wordlimit,180,90,14) end print("Set",215,125) spr(49,189,124,0) spr(33,200,124,0) if btn(4) and timer == 0 and selallow == 0 then if roundsetupselect == 3 then timer = 330 state = 4 loadingtype = 1 end end elseif state == 6 then spr(198,10,0,0,1,0,0,2,1) spr(166,10,0,5,1,0,0,4,2) spr(198,216,0,0,1,0,0,2,1) spr(166,198,0,5,1,0,0,4,2) print("P1",12,4,14) print(p1score,35,4,14) print("P2",200,4,14) print(p2score,223,4,14) waveoutlineprint("Round "..round,95,10,14,4,5) for i=0,3 do spr(138,i*16,30,0,1,0,0,2,2) end spr(136,3*16,30,5,1,0,0,2,2) for i=4,10 do spr(100,i*16,30,-1,1,0,0,2,2) end spr(136,11*16,30,5,1,1,0,2,2) for i=0,3 do spr(140,i*16,46,0,1,0,0,2,2) end spr(136,3*16,46,5,1,0,0,2,2) for i=4,10 do spr(100,i*16,46,-1,1,0,0,2,2) end spr(136,11*16,46,5,1,1,0,2,2) colprint(word,64,34,colseed) colprint(guess,64,50,colseed) if timer== 0 then if gamestate == 0 then gamestate = 1 timer = -1 gmcursorx=0 gmcursory=0 word="" guess="" elseif gamestate == 1 then gamestate = 2 timer = -1 gmcursorx=0 gmcursory=0 realword = word word=scramble(word) attempts=attround elseif gamestate == 2 then p2tempscore = attempts gamestate = 3 if attempts > 0 then sfx(10,'F-3',-1,0,volume) else sfx(11,'F-3',-1,0,volume) end timer = 150 elseif gamestate == 3 then sfx(12,'C-4',-1,0,volume) gamestate = 4 timer = 120 elseif gamestate == 4 then gamestate = 5 timer = -1 gmcursorx=0 gmcursory=0 word="" guess="" elseif gamestate == 5 then gamestate = 6 timer = -1 gmcursorx=0 gmcursory=0 realword = word word=scramble(word) attempts=attround elseif gamestate == 6 then p1tempscore = attempts if attempts > 0 then sfx(10,'F-3',-1,0,volume) else sfx(11,'F-3',-1,0,volume) end gamestate = 7 timer = 150 elseif gamestate == 7 then gamestate = 8 timer = 100 if p1tempscore > p2tempscore then p1score = p1score + 1 elseif p1tempscore < p2tempscore then p2score = p2score + 1 end elseif gamestate == 8 then if round == numrounds then state=7 if p1score ~= p2score then music(0,0,0,false,false,150,6) end else round=round+1 gamestate=0 sfx(12,'C-4',-1,0,volume) timer = 120 end end end if selallow == 0 then if ((gamestate == 1 or gamestate == 6) and btn(0)) or ((gamestate == 2 or gamestate == 5) and ((btn(8) and p1gonly==0) or (btn(0) and p1gonly==1))) then gmcursory = numberclamp(gmcursory-1,0,2) selallow = 10 sfx(4,'D-2',-1,0,volume) elseif ((gamestate == 1 or gamestate == 6) and btn(1)) or ((gamestate == 2 or gamestate == 5) and ((btn(9) and p1gonly==0) or (btn(1) and p1gonly==1))) then gmcursory = numberclamp(gmcursory+1,0,2) selallow = 10 sfx(4,'D-2',-1,0,volume) elseif ((gamestate == 1 or gamestate == 6) and btn(2)) or ((gamestate == 2 or gamestate == 5) and ((btn(10) and p1gonly==0) or (btn(2) and p1gonly==1))) then gmcursorx = numberclamp(gmcursorx-1,0,14) selallow = 10 sfx(4,'D-2',-1,0,volume) elseif ((gamestate == 1 or gamestate == 6) and btn(3)) or ((gamestate == 2 or gamestate == 5) and ((btn(11) and p1gonly==0) or (btn(3) and p1gonly==1))) then gmcursorx = numberclamp(gmcursorx+1,0,14) selallow = 10 sfx(4,'D-2',-1,0,volume) elseif ((gamestate == 1 or gamestate == 6) and btn(6)) or ((gamestate == 2 or gamestate == 5) and ((btn(14) and p1gonly==0) or (btn(6) and p1gonly==1))) then attempts = attempts - 1 if ((gamestate == 2 or gamestate == 6) and (guess == realword or attempts == 0)) or ((gamestate == 1 or gamestate == 5) and word ~= "") then timer=0 else sfx(7,'C-2',-1,0,volume) selallow = 15 end elseif (gamestate == 1 and btn(5)) or (gamestate == 5 and ((btn(13) and p1gonly==0) or (btn(5) and p1gonly==1))) then if word ~= "" then word = string.sub(word,1,string.len(word)-1) end sfx(9,'F-3',-1,0,volume) selallow = 10 elseif (gamestate == 6 and btn(5)) or (gamestate == 2 and ((btn(13) and p1gonly==0) or (btn(5) and p1gonly==1))) then if guess ~= "" then guess = string.sub(guess,1,string.len(guess)-1) end sfx(9,'F-3',-1,0,volume) selallow = 10 elseif ((gamestate == 1 and btn(4)) or (gamestate == 5 and ((btn(12) and p1gonly==0) or (btn(4) and p1gonly==1)))) and string.len(word) 0 then waveprint("P2 guessed it !",70,100,15,5) waveprint("in "..tostring(attround-attempts).." attempts",70,110,15,5) else print("Oh no ! P2 couldn't guess..",60,100,15) print("The word was : "..realword,10,120,15) end elseif gamestate == 4 then print("P1 : Look away !",50,100,15) elseif gamestate == 5 then print("P2 : Type your word !",40,20,15) -- show visual keyboard keyboarddisplay() elseif gamestate == 6 then print("P1 : Guess the word !",40,20,15) keyboarddisplay() print("Attempts left : "..tostring(attempts),40,120,15) elseif gamestate == 7 then if attempts > 0 then waveprint("P1 guessed it !",70,100,15,5) waveprint("in "..tostring(attround-attempts).." attempts",70,110,15,5) else print("Oh no ! P1 couldn't guess..",60,100,15) print("The word was : "..realword,10,120,15) end elseif gamestate == 8 then if p1tempscore > p2tempscore then print("The winner of this round is..",50,70,15) waveprint("P1 !!",105,80,14,2) spr(256,100,90,11,1,0,0,4,4) elseif p1tempscore < p2tempscore then print("The winner of this round is..",50,70,15) print("P2 !!",105,80,14) spr(256,100,90,11,1,0,0,4,4) else print("Draw ! no one wins..",55,4+70,15) end end elseif state == 7 then spr(198,10,0,0,1,0,0,2,1) spr(166,10,0,5,1,0,0,4,2) spr(198,216,0,0,1,0,0,2,1) spr(166,198,0,5,1,0,0,4,2) print("P1",12,4,14) print(p1score,35,4,14) print("P2",200,4,14) print(p2score,223,4,14) waveoutlineprint("Game Over !",95,10,14,4,5) for i=0,3 do spr(138,i*16,30,0,1,0,0,2,2) end spr(136,3*16,30,5,1,0,0,2,2) for i=4,10 do spr(100,i*16,30,-1,1,0,0,2,2) end spr(136,11*16,30,5,1,1,0,2,2) for i=0,3 do spr(140,i*16,46,0,1,0,0,2,2) end spr(136,3*16,46,5,1,0,0,2,2) for i=4,10 do spr(100,i*16,46,-1,1,0,0,2,2) end spr(136,11*16,46,5,1,1,0,2,2) colprint("Game over ?",64,34,colseed) colprint("Game over !",64,50,colseed) if p1score > p2score then print("The winner of this game is..",50,70,15) waveprint("P1 !!",105,80,14,2) spr(260,100,90,11,1,0,0,4,4) sparkle() elseif p1score < p2score then print("The winner of this game is..",50,70,15) print("P2 !!",105,80,14) spr(260,100,90,11,1,0,0,4,4) sparkle() else print("Draw ! Nobody wins..",55,4+70,15) end print(" Back Again!",29,113,14) spr(16,29,112,0) spr(48,160,112,0) if btn(5) then state = 4 timer = 330 loadingtype = 2 roundsetupselect = 0 elseif btn(6) then state = 6 round = 1 p1score = 0 p2score = 0 p1tempscore = 0 p2tempscore = 0 word="" guess="" attempts=attround colseed=(time())%16 gamestate = 0 sfx(12,'C-4',-1,0,volume) end end smokeanim() -- debug stuff --print(state,20,20) end