menus.bb 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. ;--------------------
  2. ; Init menus function
  3. ;--------------------
  4. Function InitMenus()
  5. ; Load logo/get info
  6. logo=LoadImage("media\logo.bmp") ; Load background 'block'
  7. logo_width=ImageWidth(logo)
  8. logo_height=ImageHeight(logo)
  9. Dim greyscale(logo_width,logo_height)
  10. SetBuffer ImageBuffer(logo)
  11. LockBuffer()
  12. For x=0 To ImageWidth(logo)
  13. For y=0 To ImageHeight(logo)
  14. pix=ReadPixelFast(x,y)
  15. red=(pix Shr 16) And 255
  16. green=(pix Shr 8) And 255
  17. blue=pix And 255
  18. grey=(red+green+blue)/3.0
  19. greyscale(x,y)=grey
  20. Next
  21. Next
  22. UnlockBuffer()
  23. SetBuffer BackBuffer()
  24. ; Random starting background colour
  25. randy=Int(Rnd(4))
  26. Select randy
  27. Case 0 : col=15 : cr=255 : cg=0 : cb=0
  28. Case 1 : col=3 : cr=255 : cg=255 : cb=0
  29. Case 2 : col=6 : cr=0 : cg=255 : cb=0
  30. Case 3 : col=9 : cr=0 : cg=255 : cb=255
  31. Case 4 : col=12 : cr=255 : cg=0 : cb=255
  32. End Select
  33. ; Get graphics mode info
  34. count_gfx_modes=CountGfxModes()
  35. For g=1 To count_gfx_modes
  36. If GfxMode3D(g)=True Then gm3d=gm3d+1
  37. Next
  38. Dim gfx_modes(gm3d,2) : gm3d=0
  39. For g=1 To count_gfx_modes
  40. If GfxMode3D(g)=True
  41. gg=gg+1
  42. gfx_modes(gg,0)=GfxModeWidth(g)
  43. gfx_modes(gg,1)=GfxModeHeight(g)
  44. gfx_modes(gg,2)=GfxModeDepth(g)
  45. If gfx_modes(gg,0)=width And gfx_modes(gg,1)=height And gfx_modes(gg,2)=GraphicsDepth() Then gfx_mode_option=gg
  46. EndIf
  47. Next
  48. ; Load high score data
  49. load_file=ReadFile("media\high_scores.sav")
  50. For s=1 To 10
  51. names$(s)=ReadLine(load_file)
  52. scores(s)=ReadLine(load_file)
  53. Next
  54. CloseFile load_file
  55. ; Play music
  56. music=PlayMusic("media\tune1.mid")
  57. End Function
  58. ; -------------------
  59. ; Background function
  60. ; -------------------
  61. Function Background()
  62. ; A bit of 'waiting code' inbetween colour changes
  63. If col=1 Or col=4 Or col=7 Or col=10 Or col=13
  64. sr=0
  65. sg=0
  66. sb=0
  67. ct=ct+1
  68. EndIf
  69. If ct>500 Then ct=0 : col=col+1
  70. ; Update current red, green, blue values with red, green, blue step values
  71. cr=cr+sr
  72. cg=cg+sg
  73. cb=cb+sb
  74. ; Various colour stages
  75. If cr=>255 And cg=>0 And cb=<0 And col=15 Then col=1 : cr=255 : cg=0 : cb=0
  76. If col=2 Then col=3 : dr=255 : dg=255 : db=0 : sr=(dr-cr)/fade : sg=(dg-cg)/fade : sb=(db-cb)/fade
  77. If cr>=255 And cg>=255 And cb<=0 And col=3 Then col=4 : cr=255 : cg=255 : cb=0
  78. If col=5 Then col=6 : dr=0 : dg=255 : db=0 : sr=(dr-cr)/fade : sg=(dg-cg)/fade : sb=(db-cb)/fade
  79. If cr<=0 And cg>=255 And cb<=0 And col=6 Then col=7 : cr=0 : cg=255 : cb=0
  80. If col=8 Then col=9 : dr=0 : dg=255 : db=255 : sr=(dr-cr)/fade : sg=(dg-cg)/fade : sb=(db-cb)/fade
  81. If cr<=0 And cg>=255 And cb>=255 And col=9 Then col=10 : cr=0 : cg=255 : cb=255
  82. If col=11 Then col=12 : dr=255 : dg=0 : db=255 : sr=(dr-cr)/fade : sg=(dg-cg)/fade : sb=(db-cb)/fade
  83. If cr>=255 And cg<=0 And cb>=255 And col=12 Then col=13 : cr=255 : cg=0 : cb=255
  84. If col=14 Then col=15 : dr=255 : dg=0 : db=0 : sr=(dr-cr)/fade : sg=(dg-cg)/fade : sb=(db-cb)/fade
  85. ; Draw block each frame!
  86. SetBuffer ImageBuffer(logo)
  87. LockBuffer()
  88. For x=0 To ImageWidth(logo)
  89. For y=0 To ImageHeight(logo)
  90. red=greyscale(x,y)*(cr/255.0)
  91. green=greyscale(x,y)*(cg/255.0)
  92. blue=greyscale(x,y)*(cb/255.0)
  93. pix=(red Shl 16) Or (green Shl 8) Or blue
  94. WritePixelFast x,y,pix
  95. Next
  96. Next
  97. UnlockBuffer()
  98. SetBuffer BackBuffer()
  99. ; Tile the block
  100. TileBlock logo,0,tile_y
  101. tile_y=tile_y+1
  102. If tile_y>119 Then tile_y=tile_y-120
  103. End Function
  104. ; ----------------
  105. ; Credits function
  106. ; ----------------
  107. Function Credits()
  108. ; Shadow text
  109. Color 0,0,0
  110. Text (width/2)+1,(y_space*1)+1,"Wing Ring V1.0",1
  111. Text (width/2)+1,(y_space*3)+1,"Credits",1
  112. Text (width/2)+1,(y_space*5)+1,"Programmed by Si",1
  113. Text (width/2)+1,(y_space*6)+1,"[email protected]",1
  114. Text (width/2)+1,(y_space*9)+1,"In Blitz3D",1
  115. If option=1 Then Text (width/2)+1,(y_space*7)+1,"> www.si-design.co.uk <",1 Else Text (width/2)+1,(y_space*7)+1,"www.si-design.co.uk",1
  116. If option=2 Then Text (width/2)+1,(y_space*10)+1,"> www.blitzbasic.com <",1 Else Text (width/2)+1,(y_space*10)+1,"www.blitzbasic.com",1
  117. If option=3 Then Text (width/2)+1,(y_space*11)+1,"> www.blitz3d.co.uk <",1 Else Text (width/2)+1,(y_space*11)+1,"www.blitz3d.co.uk",1
  118. If option=4 Then Text (width/2)+1,(y_space*13)+1,"> 1 Player <",1 Else Text (width/2)+1,(y_space*13)+1,"1 Player",1
  119. If option=5 Then Text (width/2)+1,(y_space*14)+1,"> 2 Player <",1 Else Text (width/2)+1,(y_space*14)+1,"2 Player",1
  120. If option=6 Then Text (width/2)+1,(y_space*15)+1,"> High Scores <",1 Else Text (width/2)+1,(y_space*15)+1,"High Scores",1
  121. If option=7 Then Text (width/2)+1,(y_space*16)+1,"> Options <",1 Else Text (width/2)+1,(y_space*16)+1,"Options",1
  122. ; White text
  123. Color 255,255,255
  124. Text (width/2)+0,(y_space*1)+0,"Wing Ring V1.0",1
  125. Text (width/2)+0,(y_space*3)+0,"Credits",1
  126. Text (width/2)+0,(y_space*5)+0,"Programmed by Si",1
  127. Text (width/2)+0,(y_space*6)+0,"[email protected]",1
  128. Text (width/2)+0,(y_space*9)+0,"In Blitz3D",1
  129. If option=1 Then Text (width/2)+0,(y_space*7)+0,"> www.si-design.co.uk <",1 Else Text (width/2)+0,(y_space*7)+0,"www.si-design.co.uk",1
  130. If option=2 Then Text (width/2)+0,(y_space*10)+0,"> www.blitzbasic.com <",1 Else Text (width/2)+0,(y_space*10)+0,"www.blitzbasic.com",1
  131. If option=3 Then Text (width/2)+0,(y_space*11)+0,"> www.blitz3d.co.uk <",1 Else Text (width/2)+0,(y_space*11)+0,"www.blitz3d.co.uk",1
  132. If option=4 Then Text (width/2)+0,(y_space*13)+0,"> 1 Player <",1 Else Text (width/2)+0,(y_space*13)+0,"1 Player",1
  133. If option=5 Then Text (width/2)+0,(y_space*14)+0,"> 2 Player <",1 Else Text (width/2)+0,(y_space*14)+0,"2 Player",1
  134. If option=6 Then Text (width/2)+0,(y_space*15)+0,"> High Scores <",1 Else Text (width/2)+0,(y_space*15)+0,"High Scores",1
  135. If option=7 Then Text (width/2)+0,(y_space*16)+0,"> Options <",1 Else Text (width/2)+0,(y_space*16)+0,"Options",1
  136. ; Up/down option
  137. If KeyHit(200)=1 Then option=option-1
  138. If KeyHit(208)=1 Then option=option+1
  139. If option>7 Then option=1
  140. If option<1 Then option=7
  141. ; Enter option
  142. If KeyHit(28)=True
  143. If option=1 Then ExecFile "http://www.si-design.co.uk/index.htm?referrer=wing_ring"
  144. If option=2 Then ExecFile "http://www.blitzbasic.com"
  145. If option=3 Then ExecFile "http://www.blitz3d.co.uk/index.htm?referrer=wing_ring"
  146. If option>3 Then screen=option
  147. EndIf
  148. End Function
  149. ; -------------------
  150. ; Highscores function
  151. ; -------------------
  152. Function HighScores()
  153. ; Shadow text
  154. Color 0,0,0
  155. Text (width/2)+1,(y_space*1)+1,"Wing Ring V1.0",1
  156. Text (width/2)+1,(y_space*3)+1,"High Scores",1
  157. If option=1 And rank=1 Then Text x_nos-17,(y_space*5)+1,"> 1." Else Text x_nos+1,(y_space*5)+1,"1."
  158. If option=1 And rank=2 Then Text x_nos-17,(y_space*6)+1,"> 2." Else Text x_nos+1,(y_space*6)+1,"2."
  159. If option=1 And rank=3 Then Text x_nos-17,(y_space*7)+1,"> 3." Else Text x_nos+1,(y_space*7)+1,"3."
  160. If option=1 And rank=4 Then Text x_nos-17,(y_space*8)+1,"> 4." Else Text x_nos+1,(y_space*8)+1,"4."
  161. If option=1 And rank=5 Then Text x_nos-17,(y_space*9)+1,"> 5." Else Text x_nos+1,(y_space*9)+1,"5."
  162. If option=1 And rank=6 Then Text x_nos-17,(y_space*10)+1,"> 6." Else Text x_nos+1,(y_space*10)+1,"6."
  163. If option=1 And rank=7 Then Text x_nos-17,(y_space*11)+1,"> 7." Else Text x_nos+1,(y_space*11)+1,"7."
  164. If option=1 And rank=8 Then Text x_nos-17,(y_space*12)+1,"> 8." Else Text x_nos+1,(y_space*12)+1,"8."
  165. If option=1 And rank=9 Then Text x_nos-17,(y_space*13)+1,"> 9." Else Text x_nos+1,(y_space*13)+1,"9."
  166. If option=1 And rank=10 Then Text x_nos-17,(y_space*14)+1,"> 10." Else Text x_nos+1,(y_space*14)+1,"10."
  167. Text x_names+1,(y_space*5)+1,names$(1)
  168. Text x_names+1,(y_space*6)+1,names$(2)
  169. Text x_names+1,(y_space*7)+1,names$(3)
  170. Text x_names+1,(y_space*8)+1,names$(4)
  171. Text x_names+1,(y_space*9)+1,names$(5)
  172. Text x_names+1,(y_space*10)+1,names$(6)
  173. Text x_names+1,(y_space*11)+1,names$(7)
  174. Text x_names+1,(y_space*12)+1,names$(8)
  175. Text x_names+1,(y_space*13)+1,names$(9)
  176. Text x_names+1,(y_space*14)+1,names$(10)
  177. If option=1 And rank=1 Then Text x_scores+1,(y_space*5)+1,scores(1)+" <" Else Text x_scores+1,(y_space*5)+1,scores(1)
  178. If option=1 And rank=2 Then Text x_scores+1,(y_space*6)+1,scores(2)+" <" Else Text x_scores+1,(y_space*6)+1,scores(2)
  179. If option=1 And rank=3 Then Text x_scores+1,(y_space*7)+1,scores(3)+" <" Else Text x_scores+1,(y_space*7)+1,scores(3)
  180. If option=1 And rank=4 Then Text x_scores+1,(y_space*8)+1,scores(4)+" <" Else Text x_scores+1,(y_space*8)+1,scores(4)
  181. If option=1 And rank=5 Then Text x_scores+1,(y_space*9)+1,scores(5)+" <" Else Text x_scores+1,(y_space*9)+1,scores(5)
  182. If option=1 And rank=6 Then Text x_scores+1,(y_space*10)+1,scores(6)+" <" Else Text x_scores+1,(y_space*10)+1,scores(6)
  183. If option=1 And rank=7 Then Text x_scores+1,(y_space*11)+1,scores(7)+" <" Else Text x_scores+1,(y_space*11)+1,scores(7)
  184. If option=1 And rank=8 Then Text x_scores+1,(y_space*12)+1,scores(8)+" <" Else Text x_scores+1,(y_space*12)+1,scores(8)
  185. If option=1 And rank=9 Then Text x_scores+1,(y_space*13)+1,scores(9)+" <" Else Text x_scores+1,(y_space*13)+1,scores(9)
  186. If option=1 And rank=10 Then Text x_scores+1,(y_space*14)+1,scores(10)+" <" Else Text x_scores+1,(y_space*14)+1,scores(10)
  187. If option=0 Then Text (width/2)+1,(y_space*16)+1,"> Back <",1 Else Text (width/2)+1,(y_space*16)+1,"Back",1
  188. ; White text
  189. Color 255,255,255
  190. Text (width/2)+0,(y_space*1)+0,"Wing Ring V1.0",1
  191. Text (width/2)+0,(y_space*3)+0,"High Scores",1
  192. If option=1 And rank=1 Then Text x_nos-18,(y_space*5)+0,"> 1." Else Text x_nos+0,(y_space*5)+0,"1."
  193. If option=1 And rank=2 Then Text x_nos-18,(y_space*6)+0,"> 2." Else Text x_nos+0,(y_space*6)+0,"2."
  194. If option=1 And rank=3 Then Text x_nos-18,(y_space*7)+0,"> 3." Else Text x_nos+0,(y_space*7)+0,"3."
  195. If option=1 And rank=4 Then Text x_nos-18,(y_space*8)+0,"> 4." Else Text x_nos+0,(y_space*8)+0,"4."
  196. If option=1 And rank=5 Then Text x_nos-18,(y_space*9)+0,"> 5." Else Text x_nos+0,(y_space*9)+0,"5."
  197. If option=1 And rank=6 Then Text x_nos-18,(y_space*10)+0,"> 6." Else Text x_nos+0,(y_space*10)+0,"6."
  198. If option=1 And rank=7 Then Text x_nos-18,(y_space*11)+0,"> 7." Else Text x_nos+0,(y_space*11)+0,"7."
  199. If option=1 And rank=8 Then Text x_nos-18,(y_space*12)+0,"> 8." Else Text x_nos+0,(y_space*12)+0,"8."
  200. If option=1 And rank=9 Then Text x_nos-18,(y_space*13)+0,"> 9." Else Text x_nos+0,(y_space*13)+0,"9."
  201. If option=1 And rank=10 Then Text x_nos-18,(y_space*14)+0,"> 10." Else Text x_nos+0,(y_space*14)+0,"10."
  202. Text x_names+0,(y_space*5)+0,names$(1)
  203. Text x_names+0,(y_space*6)+0,names$(2)
  204. Text x_names+0,(y_space*7)+0,names$(3)
  205. Text x_names+0,(y_space*8)+0,names$(4)
  206. Text x_names+0,(y_space*9)+0,names$(5)
  207. Text x_names+0,(y_space*10)+0,names$(6)
  208. Text x_names+0,(y_space*11)+0,names$(7)
  209. Text x_names+0,(y_space*12)+0,names$(8)
  210. Text x_names+0,(y_space*13)+0,names$(9)
  211. Text x_names+0,(y_space*14)+0,names$(10)
  212. If option=1 And rank=1 Then Text x_scores+0,(y_space*5)+0,scores(1)+" <" Else Text x_scores+0,(y_space*5)+0,scores(1)
  213. If option=1 And rank=2 Then Text x_scores+0,(y_space*6)+0,scores(2)+" <" Else Text x_scores+0,(y_space*6)+0,scores(2)
  214. If option=1 And rank=3 Then Text x_scores+0,(y_space*7)+0,scores(3)+" <" Else Text x_scores+0,(y_space*7)+0,scores(3)
  215. If option=1 And rank=4 Then Text x_scores+0,(y_space*8)+0,scores(4)+" <" Else Text x_scores+0,(y_space*8)+0,scores(4)
  216. If option=1 And rank=5 Then Text x_scores+0,(y_space*9)+0,scores(5)+" <" Else Text x_scores+0,(y_space*9)+0,scores(5)
  217. If option=1 And rank=6 Then Text x_scores+0,(y_space*10)+0,scores(6)+" <" Else Text x_scores+0,(y_space*10)+0,scores(6)
  218. If option=1 And rank=7 Then Text x_scores+0,(y_space*11)+0,scores(7)+" <" Else Text x_scores+0,(y_space*11)+0,scores(7)
  219. If option=1 And rank=8 Then Text x_scores+0,(y_space*12)+0,scores(8)+" <" Else Text x_scores+0,(y_space*12)+0,scores(8)
  220. If option=1 And rank=9 Then Text x_scores+0,(y_space*13)+0,scores(9)+" <" Else Text x_scores+0,(y_space*13)+0,scores(9)
  221. If option=1 And rank=10 Then Text x_scores+0,(y_space*14)+0,scores(10)+" <" Else Text x_scores+0,(y_space*14)+0,scores(10)
  222. If option=0 Then Text (width/2)+0,(y_space*16)+0,"> Back <",1 Else Text (width/2)+0,(y_space*16)+0,"Back",1
  223. ; Input routine
  224. If rank>=1 And rank<=10
  225. gk=GetKey()
  226. If Len(names$(rank))<=4 Or gk=8 ; If size of string is less than six characters long or backspace key is pressed
  227. Select gk
  228. Case 0 ; Nothing! Just stops no key press (0) being used with the default option which results in ||| being shown
  229. Case 13 ; Stops return key being used
  230. Case 28 ; Stops up cursor key being used
  231. Case 29 ; Stops down cursor key being used
  232. Case 8 : If Len(names$(rank))>0 Then names$(rank)=Left$(names$(rank),Len(names$(rank))-1)
  233. Default : names$(rank)=names$(rank)+Chr$(gk)
  234. End Select
  235. EndIf
  236. EndIf
  237. ; Up/down option
  238. If KeyHit(200)=1 Then option=option-1
  239. If KeyHit(208)=1 Then option=option+1
  240. ; Choice of options depending on whether high score is yet to be entered or not
  241. If rank<1 Or rank>10
  242. If option>0 Then option=0
  243. If option<0 Then option=0
  244. Else
  245. If option>1 Then option=0
  246. If option<0 Then option=1
  247. EndIf
  248. ; Enter option
  249. If KeyHit(28)=True
  250. If option=0 Then screen=option : option=6 ; Back
  251. ; Save scores
  252. If option=1
  253. save_file=WriteFile("high_scores.sav")
  254. For s=1 To 10
  255. WriteLine save_file,names$(s)
  256. WriteLine save_file,scores(s)
  257. Next
  258. CloseFile save_file
  259. rank=11
  260. EndIf
  261. EndIf
  262. End Function
  263. ; ----------------
  264. ; Options function
  265. ; ----------------
  266. Function Options()
  267. kh=KeyHit(28)
  268. ; Shadow text
  269. Color 0,0,0
  270. Text (width/2)+1,(y_space*1)+1,"Wing Ring V1.0",1
  271. Text (width/2)+1,(y_space*3)+1,"Options",1
  272. Text (width/2)+1,(y_space*5)+1,"Graphics Mode:",1
  273. Text (width/2)+1,(y_space*8)+1,"Windowed:",1
  274. If option=1
  275. Text (width/2)+1,(y_space*6)+1,">"+gfx_modes(gfx_mode_option,0)+"x"+gfx_modes(gfx_mode_option,1)+"x"+gfx_modes(gfx_mode_option,2)+"<",1
  276. Else
  277. Text (width/2)+1,(y_space*6)+1,gfx_modes(gfx_mode_option,0)+"x"+gfx_modes(gfx_mode_option,1)+"x"+gfx_modes(gfx_mode_option,2),1
  278. EndIf
  279. If option=2
  280. If Windowed3D()=False
  281. Text (width/2)+1,(y_space*9)+1,"> Unavailable <",1
  282. Else
  283. If mode_option=1 Then Text (width/2)+1,(y_space*9)+1,"> No <",1
  284. If mode_option=2 Then Text (width/2)+1,(y_space*9)+1,"> Yes <",1
  285. EndIf
  286. Else
  287. If Windowed3D()=False
  288. Text (width/2)+1,(y_space*9)+1,"Unavailable",1
  289. Else
  290. If mode_option=1 Then Text (width/2)+1,(y_space*9)+1,"No",1
  291. If mode_option=2 Then Text (width/2)+1,(y_space*9)+1,"Yes",1
  292. EndIf
  293. EndIf
  294. If option=0 Then Text (width/2)+1,(y_space*16)+1,"> Back <",1 Else Text (width/2)+1,(y_space*16)+1,"Back",1
  295. ; White text
  296. Color 255,255,255
  297. Text (width/2)+0,(y_space*1)+0,"Wing Ring V1.0",1
  298. Text (width/2)+0,(y_space*3)+0,"Options",1
  299. Text (width/2)+0,(y_space*5)+0,"Graphics Mode:",1
  300. Text (width/2)+0,(y_space*8)+0,"Windowed:",1
  301. If option=1
  302. Text (width/2)+0,(y_space*6)+0,">"+gfx_modes(gfx_mode_option,0)+"x"+gfx_modes(gfx_mode_option,1)+"x"+gfx_modes(gfx_mode_option,2)+"<",1
  303. Else
  304. Text (width/2)+0,(y_space*6)+0,gfx_modes(gfx_mode_option,0)+"x"+gfx_modes(gfx_mode_option,1)+"x"+gfx_modes(gfx_mode_option,2),1
  305. EndIf
  306. If option=2
  307. If Windowed3D()=False
  308. Text (width/2)+0,(y_space*9)+0,"> Unavailable <",1
  309. Else
  310. If mode_option=1 Then Text (width/2)+0,(y_space*9)+0,"> No <",1
  311. If mode_option=2 Then Text (width/2)+0,(y_space*9)+0,"> Yes <",1
  312. EndIf
  313. Else
  314. If Windowed3D()=False
  315. Text (width/2)+0,(y_space*9)+0,"Unavailable",1
  316. Else
  317. If mode_option=1 Then Text (width/2)+0,(y_space*9)+0,"No",1
  318. If mode_option=2 Then Text (width/2)+0,(y_space*9)+0,"Yes",1
  319. EndIf
  320. EndIf
  321. If option=0 Then Text (width/2)+0,(y_space*16)+0,"> Back <",1 Else Text (width/2)+0,(y_space*16)+0,"Back",1
  322. ; Up/down option
  323. If KeyHit(200)=1 Then option=option-1
  324. If KeyHit(208)=1 Then option=option+1
  325. If option>2 Then option=0
  326. If option<0 Then option=2
  327. ; Enter option
  328. If kh=True And option=1 Then gfx_mode_option=gfx_mode_option+1 : If gfx_mode_option=>count_gfx_modes Then gfx_mode_option=1
  329. If kh=True And option=2 And Windowed3D()=True ; Only allow user to toggle windowed mode option if windowed 3d mode is available
  330. If mode_option=1 Then mode_option=2 Else mode_option=1
  331. EndIf
  332. If kh=True And option=0
  333. screen=option
  334. w=gfx_modes(gfx_mode_option,0)
  335. h=gfx_modes(gfx_mode_option,1)
  336. d=gfx_modes(gfx_mode_option,2)
  337. If width<>w Or height<>h Or depth<>d Or mode_option<>mode
  338. width=w : height=h : depth=d : mode=mode_option
  339. Graphics3D width,height,depth,mode
  340. logo=LoadImage("logo.bmp")
  341. y_space#=height/18
  342. x_space=width/71 : x_nos=((width/4)-((9*3)/2)) : x_names=((width/2)-((9*5)/2)) : x_scores=((width/1.33)-((9*5)/2))
  343. LoadMedia() : CreateEntities() : InitCollisions()
  344. EndIf
  345. EndIf
  346. End Function