Computer Science Canada guitar( acualy possible |
Author: | r.m_spy [ Sun Mar 02, 2008 7:47 am ] |
Post subject: | guitar( acualy possible |
var k:array char of boolean var announceFont : int := Font.New ("Sanserif:30:bold") var announcFont : int := Font.New ("Sanserif:30:bold") procedure CentreFont (s : string, x, y, f, clr : int) var w : int := Font.Width (s, f) Font.Draw (s, x - w div 2, y, f, clr) end CentreFont %leave this part alone var a:char:=chr(97) var dq:char:=chr(100) var s:char:=chr(115) var br:int:=0 var be:int:=0 var d:int:=maxx+150 var v:int:=maxx+50 var w:int:=Rand.Int(maxx,maxx+300) var score:int:=0 var bl:int:=0 var xz:int:=0 var com:int:=1 var speed:int var row:int var combo:int:=10 var xent:int:=0 loop delay(100) cls drawfillbox(0,0,maxx,maxy,black) CentreFont("raymond pictures",maxx div 2,maxy div 2,announcFont,red) delay(200) cls delay(100) cls drawfillbox(0,0,maxx,maxy,black) drawline(maxx-150,maxy,maxx-100,maxy,darkgrey) drawline(maxx-100,maxy,maxx-200,maxy-100,darkgrey) drawline(maxx-150,maxy,maxx-250,maxy-100,darkgrey) drawline(maxx-200,maxy-100,maxx-170,maxy-90,darkgrey) drawline(maxx-250,maxy-100,maxx-220,maxy-90,darkgrey) drawline(maxx-300,maxy-200,maxx-220,maxy-90,darkgrey) drawline(maxx-250,maxy-200,maxx-170,maxy-90,darkgrey) drawline(maxx-300,maxy-200,maxx-270,maxy-190,darkgrey) drawline(maxx-250,maxy-200,maxx-220,maxy-190,darkgrey) drawline(370,210,270,110,darkgrey) drawline(420,210,320,110,darkgrey) drawline(320,110,350,120,darkgrey) drawline(270,110,300,120,darkgrey) drawline(170,0,300,120,darkgrey) drawline(220,0,350,120,darkgrey) drawline(170,0,220,0,darkgrey) drawfill(maxx div 2+50,maxy div 2,yellow,darkgrey) CentreFont("raymond pictures",maxx div 2,maxy div 2,announcFont,brightred) delay(100) cls drawfillbox(0,0,maxx,maxy,black) CentreFont("raymond pictures",maxx div 2,maxy div 2,announcFont,red) delay(750) cls drawfillbox(0,0,maxx,maxy,black) drawline(maxx-150,maxy,maxx-100,maxy,darkgrey) drawline(maxx-100,maxy,maxx-200,maxy-100,darkgrey) drawline(maxx-150,maxy,maxx-250,maxy-100,darkgrey) drawline(maxx-200,maxy-100,maxx-170,maxy-90,darkgrey) drawline(maxx-250,maxy-100,maxx-220,maxy-90,darkgrey) drawline(maxx-300,maxy-200,maxx-220,maxy-90,darkgrey) drawline(maxx-250,maxy-200,maxx-170,maxy-90,darkgrey) drawline(maxx-300,maxy-200,maxx-270,maxy-190,darkgrey) drawline(maxx-250,maxy-200,maxx-220,maxy-190,darkgrey) drawline(370,210,270,110,darkgrey) drawline(420,210,320,110,darkgrey) drawline(320,110,350,120,darkgrey) drawline(270,110,300,120,darkgrey) drawline(170,0,300,120,darkgrey) drawline(220,0,350,120,darkgrey) drawline(170,0,220,0,darkgrey) drawfill(maxx div 2+50,maxy div 2,yellow,darkgrey) CentreFont("raymond pictures",maxx div 2,maxy div 2,announcFont,brightred) xent:=xent+1 exit when xent=3 end loop cls put"options, enter the bracet to the right of your choice" put"" put"speed, slow(10),normal(20), fast(40), and legend(50)" get speed put"what level. eazy(1),mediem(2),or hard(3)" get row loop delay(100) cls put"score:",score put"combo:x",com put"speed:",speed put"level:".. if row=1 then put"eazy" elsif row=2 then put"normal" elsif row=3 then put"hard" end if drawfillbox(100,0,200,maxx,brightgreen) if row=3 then if be=0 then drawoval(d,maxy div 2-100,50,50,black) elsif be=1 then drawfilloval(d,maxy div 2-100,50,50,black) end if end if if row=1 or row=2 or row=3 then if bl=0 then drawoval(v,maxy div 2+100,50,50,black) elsif bl=1 then drawfilloval(v,maxy div 2+100,50,50,black) end if end if if row=3 or row=2 then if br=0 then drawoval(w,maxy div 2,50,50,black) elsif br=1 then drawfilloval(w,maxy div 2,50,50,black) end if end if if row=1 or row=2 or row=3 then CentreFont ("A", v, maxy div 2+90,announceFont ,brightred) end if if row=2 or row=3 then CentreFont ("S", w, maxy div 2-10,announceFont ,brightred) end if if row=3 then CentreFont ("D", d, maxy div 2-110,announceFont ,brightred) end if Input.KeyDown(k) d:=d-speed v:=v-speed w:=w-speed if v<300 and v>200 then if k(a) then if score>0 then score:=score-1 end if end if end if if v<200 and v>100 then if k(a) then if bl=0 then score:=score+com xz:=xz+1 bl:=bl+1 end if end if end if if row=2 or row=3 then if w<300 and w>200 then if k(s) then if score>0 then score:=score-1 end if end if end if if w<200 and w>100 then if k(s) then if br=0 then score:=score+com xz:=xz+1 br:=br+1 end if end if end if end if if row=3 then if d<300 and d>200 then if k(dq) then if score>0 then score:=score-1 end if end if end if if d<200 and d>100 then if k(dq) then if be=0 then score:=score+com xz:=xz+1 be:=be+1 end if end if end if if row=3 then if d<0 then randint(d,maxx,maxx+300) if be=1 then be:=be-1 else if xz=0 then if com<2 then else com:=com-1 end if else xz:=0 end if end if end if end if end if if v<0 then v:=maxx+50 if bl=1 then bl:=bl-1 else if xz=0 then if com<2 then else com:=com-1 end if else xz:=0 end if end if end if if row=2 or row=3 then if w<0 then randint(w,maxx,maxx+300) if br=1 then br:=br-1 else if xz=0 then if com<2 then else com:=com-1 end if else if xz=0 then end if end if end if end if end if if xz>combo then com:=com+1 xz:=0 end if end loop |
Author: | BigBear [ Sun Mar 02, 2008 9:56 am ] |
Post subject: | Re: guitar( acualy possible |
Use View.Set ("offscreenonly") to remove flashing. Use View.Update after you put something to the screen if you put multiple thing only put View.Update at the end usually before you get something from the user. |
Author: | Zren [ Thu Mar 06, 2008 12:14 am ] |
Post subject: | Re: guitar( acualy possible |
Spellcheck: Medium It's not original in the least...It also has a flaw where you can just hold down all A, S & D and it will work the same. I like the beginning flashes, but it's like a colossus in code. |
Author: | SNIPERDUDE [ Tue Mar 18, 2008 3:06 pm ] |
Post subject: | RE:guitar( acualy possible |
Also... USE CODE TAGS!!! |
Author: | syntax_error [ Tue Mar 18, 2008 7:06 pm ] |
Post subject: | RE:guitar( acualy possible |
try using normal var names nothing the sort of xz thus other can fully understand much faster; further more as said before CODE TAGS that is a lot of code to look at! |
Author: | Doug101 [ Wed Apr 02, 2008 8:32 am ] |
Post subject: | Re: guitar( acualy possible |
cool game needs more color. |