|
Post by Rod on Apr 3, 2018 13:38:53 GMT
This is a small collection of self contained games. They don't need any .bmps or .wav or.mid files. They run but are not complete and have been contributed by members over time. The .zip will unpack on your PC as a single folder containing all of the .bas files. The general idea is that you should post improvements or new games here and we will build a new Compendium. Games.zip (44.87 KB)
|
|
|
Post by B+ on Apr 3, 2018 16:21:43 GMT
Great collection Rod, nice work!
|
|
|
Post by Rod on Apr 6, 2018 12:35:33 GMT
Fighter Ace with less bugs and the blue baron in place, with a gun that works. 'Fighter aces, much work to do.
nomainwin ' find how much whitespace the windows scheme is taking ' Anatoly's tip WindowWidth = 200 WindowHeight = 200 open "Ajusting..." for graphics_nf_nsb as #1 #1, "home ; down ; posxy w h" w=200-2*w : h = 200-2*h close #1
' setup a window and graphicbox WindowWidth = 800+w WindowHeight = 600+h UpperLeftX = (DisplayWidth-WindowWidth)/2 UpperLeftY = (DisplayHeight-WindowHeight)/2 graphicbox #1.g, 1,1,800,600
open "Blue Baron Dog Fight (Press H for help)" for window_nf as #1 #1 "trapclose [quit]" #1.g "when mouseMove [movemouse]" #1.g "when characterInput [keyboard]" #1.g "setfocus" gosub [graphics]
[start] true=1 false=0 Rad=57.29577951 'Radian factor for trig Pitch=0 'up or down attitude -50 to 50 AoB=0 'angle of bank -45 to 45 Turn=0 'turn dela Hseg=1 'the horizon is painted as a series of sprites 1 to 42 that cycle
shotx=-100 shoty=-100 shotz=200 shotxvelocity=0 shotyvelocity=30 shotzvelocity=10 gravity=.25
timer 56, [update] wait
[update] #1.g "drawsprites"
[horizon] Horizon=50+Pitch*3 'where to place the mid point horizon Hdelta=30*sin(AoB/Rad) 'how much to step down or up right to left Hstart=Hstart-AoB 'how much the stars/sprites move left or right if Hstart>0 then Hstart=-20 : Hseg=Hseg-1 if Hstart<-40 then Hstart=-20 : Hseg=Hseg+1 if Hseg>42 then Hseg=1 if Hseg<1 then Hseg=42 Hx=Hstart Hy=Horizon+20*Hdelta 'first Y pos is 20 delta for n= 1 to 42 #1.g " spritexy b";str$(Hseg);" ";Hx;" ";Hy Hseg=Hseg+1 if Hseg>42 then Hseg=1 Hy=Hy-Hdelta Hx=Hx+20 next n
[plane] size=size+1 if size > 300 then size=0 Px=Px+Pxm-int(AoB/2) Py=Py+Pym+int(Pitch/4)+downed 'if the plane is off screen as sized then start again if Px<0-100*size or Px>800 or Py<0-50*size or Py>600 then Px=400 Py=200 size=10 downed=0 end if If rnd(0)<.01 then Pxm=1-Int(rnd(0)*3) if rnd(0)<.01 then Pym=1-Int(rnd(0)*3) #1.g "spritescale plane ";size #1.g " spritexy plane ";Px;" ";Py
[shot] if fire=1 then shotz=shotz-shotzvelocity if shotz<0 then shotx=390 shoty=280-Pitch shotz=200 shotxvelocity=0 shotyvelocity=5 shotzvelocity=10 fire=0 end if shotx=shotx+shotxvelocity-Hdelta shotyvelocity=shotyvelocity-gravity shoty=shoty-int(shotyvelocity)+abs(Hdelta) else shoty=280-Pitch end if #1.g "spritescale shot ";shotz #1.g "spritexy shot "; shotx; " "; shoty
[baron] #1.g "spritexy baron 0 ";200-Pitch
#1.g "spritecollides shot list$" if instr(list$,"plane",1) and fire then downed=20 wait
[keyboard] ' read the keyboard timer 0 if help=1 then print #1.g, "discard ; redraw" help=0 end if key$ = right$(Inkey$,1) select case key$ case "h" ' help page #1.g "backcolor darkblue ; color white ; Place 100 10 ; boxfilled 700 180" #1.g "font comic sans 18" #1.g "place 110 40" #1.g "\Blue Baron Flight Simulator (He flew at night)" #1.g "font comic sans 14" #1.g "place 110 70" #1.g "\Mouse left right up down to fly" #1.g "place 110 100" #1.g "\Space to fire" #1.g "place 110 130" #1.g "\Any key except H to leave Help" #1.g "place 110 160" #1.g "\Quit to leave game" help=1 #1.g "setfocus" wait case " " 'fire fire=1 case "q" 'quit goto [quit] end select timer 56, [update] wait
[movemouse] if MouseX<oldx then [left] if MouseX>oldx then [right] if MouseY<oldy then [down] if MouseY>oldy then [up] wait
[left] AoB=AoB-(AoB>-45) oldx=MouseX wait
[right] AoB=AoB+(AoB<45) oldx=MouseX wait
[down] Pitch=Pitch-(Pitch>-50) oldy=MouseY wait
[up] Pitch=Pitch+(Pitch<50) oldy=MouseY wait
[quit] timer 0 for n = 1 to 42 unloadbmp "bmp";str$(n) next n unloadbmp "bak" close #1 end
[graphics] #1.g "down ; backcolor white ; color white ; place 0 0 ;boxfilled 10 10" #1.g "backcolor black ; color black ;place 0 10 ; boxfilled 10 20" #1.g "backcolor black ; place 4 4 ; circlefilled 4" #1.g "backcolor yellow ; place 4 14 ; circlefilled 4" #1.g "getbmp shot 0 0 10 20" #1.g "down ; backcolor white ; color white ; place 0 0 ;boxfilled 100 50" #1.g "backcolor black ; color black ;place 0 50 ; boxfilled 100 100" #1.g "color black ; backcolor black" #1.g "line 2 0 98 0" #1.g "line 0 1 100 1" #1.g "line 2 2 98 2" #1.g "line 8 22 50 30 ; line 50 30 92 22" #1.g "line 8 23 50 31 ; line 50 31 92 23" #1.g "line 8 24 50 32 ; line 50 32 92 24" #1.g "line 0 1 8 23 ; line 99 1 92 23" #1.g "size 2 ;place 50 21 ; circlefilled 10 ; size 1" #1.g "place 50 10 ; circle 2 " #1.g "line 30 3 36 30 ; line 69 3 63 30 " #1.g "line 36 30 36 40 ; line 63 30 63 40" #1.g "place 36 40 ; circlefilled 3 ; place 36 36 ; circlefilled 3" #1.g "place 63 40 ; circlefilled 3 ; place 63 36 ; circlefilled 3"
#1.g "color darkred ; line 2 50 98 50" #1.g "color red ; line 0 51 100 51" #1.g "color darkred ; line 2 52 98 52" #1.g "color darkred ; line 8 72 50 80 ; line 50 80 92 72" #1.g "color red ; line 8 73 50 81 ; line 50 81 92 73" #1.g "color darkred ; line 8 74 50 82 ; line 50 82 92 74" #1.g "color darkgray ; line 0 51 8 73 ; line 99 51 92 73" for n= 1 to 10 #1.g "size 2 ; color ";100+n*10;" ";10;" ";10 #1.g "place 50 71 ; circle ";n next #1.g "size 1 ;color white ; place 50 60 ; circle 2" #1.g "size 1 ; backcolor darkgray ; color darkgray" #1.g "line 30 53 36 80 ; line 69 53 63 80 " #1.g "line 36 80 36 90 ; line 63 80 63 90" #1.g "place 36 90 ; circlefilled 3 ; place 36 86 ; circlefilled 3" #1.g "place 63 90 ; circlefilled 3 ; place 63 86 ; circlefilled 3" #1.g "size 1 ;color red ; line 50 62 50 80 ; line 30 71 70 71"
#1.g "getbmp plane 0 0 100 100"
#1.g "color darkblue ; line 2 50 98 50" #1.g "color blue ; line 0 51 100 51" #1.g "color darkblue ; line 2 52 98 52" #1.g "color darkblue ; line 8 72 50 80 ; line 50 80 92 72" #1.g "color blue ; line 8 73 50 81 ; line 50 81 92 73" #1.g "color darkblue ; line 8 74 50 82 ; line 50 82 92 74" #1.g "color darkgray ; line 0 51 8 73 ; line 99 51 92 73" for n= 1 to 10 #1.g "size 2 ; color ";10;" ";10;" ";100+n*10 #1.g "place 50 71 ; circle ";n next #1.g "size 1 ;color white ; place 50 60 ; circle 2 " #1.g "size 1 ; backcolor darkgray ; color darkgray" #1.g "line 30 53 36 80 ; line 69 53 63 80 " #1.g "line 36 80 36 90 ; line 63 80 63 90" #1.g "place 36 90 ; circlefilled 3 ; place 36 86 ; circlefilled 3" #1.g "place 63 90 ; circlefilled 3 ; place 63 86 ; circlefilled 3" #1.g "size 1 ;color blue ; line 50 62 50 80 ; line 30 71 70 71" #1.g "getbmp baron 0 0 100 100" print #1.g, "down ;fill black" print #1.g, "getbmp bak 0 0 800 400 ; background bak" for n = 200 to 300 print #1.g, "color 0 0 ";n-200;" ; line 0 ";n;" 800 ";n next n print #1.g, "color white" for n= 1 to 50 print #1.g, "set ";rnd(0)*800;" ";rnd(0)*50+200 next for n=1 to 42 print #1.g,"getbmp bmp";str$(n);" ";n*10;" 0 10 398" print #1.g, "addsprite b";str$(n);" bmp";str$(n) print #1.g, "spritescale b";str$(n);" 200" next n #1.g "addsprite shot shot" print #1.g, "addsprite plane plane" #1.g "addsprite baron baron" #1.g "spritescale baron 800" #1.g "spritexy baron 0 300"
return
|
|