Anarchy Ball Race 03 Open Source von ??? |
Bitte nicht sagen der ist unoptimiert , denn es war mein 2tes Game und wurde in 4 Wochen geproggt =) , außerdem kannte ich weder Functions noch wusste ich wie ein Framerate begrenzer richtig funzt noch kannte ich nen Timer ( usw usw usw usw ) [u:aa0fc5b277][b:aa0fc5b277]DER MAIN CODE[/b:aa0fc5b277][/u:aa0fc5b277] [code:1:aa0fc5b277];Basic Bullshit Team 2003 ; Coder : -j0k3-> am 03.04 AppTitle "Anarchy Ball Race" file = ReadFile("graphic.txt") If Not file Then RuntimeError "File > graphic.txt < not found" graphic = ReadLine(file) detail = ReadLine(file) CloseFile file file5 = ReadFile("user.txt") If Not file5 Then RuntimeError "File > user.txt < not found" username$ = ReadLine(file5) CloseFile file5 If graphic = 1 Then Graphics 800,600,16,1 If graphic = 2 Then Graphics 800,600,16,2 SetBuffer BackBuffer() Color 255,255,255 Include "intro.bb" Include "mainmenue.bb" FlushKeys() SeedRnd MilliSecs() screenshot = CreateImage(800,600) ;-------------------------------------------------------------------------------------------------> ;############################### Code fürs eigentliche Spiel #####################################> ;-------------------------------------------------------------------------------------------------> ;Variabel Deklaration trafficcountmax = 220 Dim carpic1(360) Dim carpic2(360) Dim background(50) Dim bgtype(20,2000) Dim trafficside(trafficcountmax) Dim movetraffic(trafficcountmax) Dim xtraffic(trafficcountmax) Dim ytraffic(trafficcountmax) Dim trafficpic(trafficcountmax) Dim trafficimg(trafficcountmax) Dim sky1(5) Dim ysky1(5) Dim rock(196) Dim yrock(196) Dim damage(10) Dim sf(1000) Dim xsf(1000) Dim ysf(1000) Dim tacho(220) Dim leveltime$(7) Dim levelsec(7) Dim levelmilli(7) Dim xtire(4) Dim ytire(4) Dim winkeltire(4) Dim xsmoke(40) Dim ysmoke(40) Dim smokeframe(40) Dim xlight(4) Dim ylight(4) Dim winkellight(4) Dim light(4) Dim xslide(100) Dim yslide(100) Dim winkelslide(100) Dim textnum (100000) Dim ycrashsave(50) Dim hitlistnum#(10) Dim hitlistname$(10) Dim temp$(10) Dim tempname$(10) ;------------------> Radio Images & Vars radiobg = LoadImage("gfx adiog.bmp") MaskImage radiobg,255,0,255 rdvisual = LoadAnimImage ("gfx adiovis.bmp",59,25,0,3) rdmsg = LoadImage("gfx adio adiomsg.bmp") MaskImage rdmsg,255,0,255 Dim mp3(20) Dim mp3name$(20) mp3ver = ReadDir("radio") Repeat tempfilename$ = Lower$(NextFile$(mp3ver)) If Instr(tempfilename$,".mp3")>0 Then lmp3 = lmp3 + 1 If lmp3 > 20 Then RuntimeError "Es sind mehr als 20 Mp3s in dem Ordner , obwohl nur hoechstens 20 Unterstuezt werden !!! Bitte aendern sie es und starten sie das Spiel neu" mp3name$(lmp3) = tempfilename$ Cls DrawImage load,0,0 Text 250,550,"Loading : " + mp3name$(lmp3) Flip mp3(lmp3) = LoadSound("radio"+ mp3name$(lmp3)) EndIf Until tempfilename$= "" trackanzahl = lmp3 lmp3 = 0 vol# = 0.7 ChannelVolume kanal2,0.4 ;------------------> Set new Load Screen Cls DrawImage load,0,0 Text 300,550,"Loading GFX and Random Sounds" Flip ;------------------> Car Images If username$ = "666 Biker" Then cartype = 100 If username$ = "Taxidriver" Then cartype = 101 TFormFilter 0 For lc = 0 To 359 Step 2 If cartype = 1 Then carpic1(lc) = LoadAnimImage("gfxcar1.bmp",50,80,0,1) If cartype = 2 Then carpic1(lc) = LoadAnimImage("gfxcar2.bmp",50,80,0,1) If cartype = 100 Then carpic1(lc) = LoadAnimImage("gfx raffic7.bmp",50,80,0,1) If cartype = 101 Then carpic1(lc) = LoadAnimImage("gfx raffic8.bmp",50,80,0,1) MaskImage carpic1(lc),255,0,255 RotateImage carpic1(lc),lc MidHandle carpic1(lc) Next waste = LoadImage("gfxwaste.bmp") MaskImage waste,255,0,255 emptyimg = LoadImage("gfxempty.bmp") MaskImage emptyimg,255,0,255 ;------------------> Tacho + Hud damage(1) = LoadImage("gfxhuddamage1.bmp") damage(2) = LoadImage("gfxhuddamage2.bmp") damage(3) = LoadImage("gfxhuddamage3.bmp") damage(4) = LoadImage("gfxhuddamage4.bmp") damage(5) = LoadImage("gfxhuddamage5.bmp") damage(6) = LoadImage("gfxhuddamage6.bmp") overcar = LoadImage("gfxhudoverdamage.bmp") MaskImage overcar,255,0,255 tachobg2 = LoadImage("gfxhud achobg2.bmp") tachobg3 = LoadImage("gfxhud achobg3.bmp") tachobg = LoadImage("gfxhud achobg.bmp") MidHandle tachobg MaskImage tachobg,255,0,255 For ct = o To 220 Step 5 tacho(ct) = LoadImage("gfxhud acho.bmp") MaskImage tacho(ct),255,0,255 RotateImage tacho(ct),ct MidHandle tacho(ct) Next ;------------------> Landscape Images background(1) = LoadImage("gfxsidewalk.jpg") background(2) = LoadImage("gfxstreet.jpg") background(3) = LoadImage("gfxstreet2.jpg") background(4) = LoadImage("gfxstreet3.jpg") background(5) = LoadImage("gfxgrass.jpg") background(6) = LoadImage("gfxside1.jpg") background(7) = LoadImage("gfxside2.jpg") background(8) = LoadImage("gfxside3.jpg") background(9) = LoadImage("gfxside3end2.jpg") background(10) = LoadImage("gfxside3end.jpg") background(11) = LoadImage("gfxwaterwallh1.jpg") background(12) = LoadImage("gfxwaterwallh2.jpg") background(13) = LoadImage("gfxwaterwallv1.jpg") background(14) = LoadImage("gfxwaterwallv2.jpg") background(15) = LoadImage("gfxwaterbridgeh.jpg") background(16) = LoadImage("gfxwaterbridgev.jpg") background(17) = LoadImage("gfxwaterwallcorner1.jpg") background(18) = LoadImage("gfxwaterwallcorner2.jpg") background(19) = LoadImage("gfxwaterwallcorner3.jpg") background(20) = LoadImage("gfxwaterwallcorner4.jpg") background(21) = LoadImage("gfxwater.jpg") background(22) = LoadImage("gfxcliff1.bmp") background(23) = LoadImage("gfxcliff2.bmp") background(24) = LoadImage("gfxcliff3.bmp") background(25) = LoadImage("gfxcliff4.bmp") For mb = 22 To 25 MaskImage background(mb),255,0,255 Next background(26) = LoadImage("gfxstreet3.jpg") background(27) = LoadImage("gfxdust.jpg") background(28) = LoadImage("gfxdust_wood.jpg") background(29) = LoadImage("gfxside1_dust.jpg") background(30) = LoadImage("gfxside2_dust.jpg") background(31) = LoadImage("gfxcliff1_dust.bmp") background(32) = LoadImage("gfxcliff2_dust.bmp") background(33) = LoadImage("gfxcliff3_dust.bmp") background(34) = LoadImage("gfxcliff4_dust.bmp") For mb = 31 To 34 MaskImage background(mb),255,0,255 Next background(35) = LoadImage("gfxsnow_wood.jpg") background(36) = LoadImage("gfxside1_snow.jpg") background(37) = LoadImage("gfxside2_snow.jpg") background(38) = LoadImage("gfxorder.jpg") background(39) = LoadImage("gfxstreet_snow.jpg") background(40) = LoadImage("gfxsnow.jpg") background(41) = LoadImage("gfxstart.jpg") background(42) = LoadImage("gfxgrass_rock.jpg") background(43) = LoadImage("gfxgrass_pipe.jpg") background(44) = LoadImage("gfxsign_a_zagreb.bmp") background(45) = LoadImage("gfxsign_b_zagreb.bmp") background(46) = LoadImage("gfxempty.bmp") MaskImage background(46),255,0,255 ;----------> Random Images expl = LoadAnimImage("gfxeffectsexplosion.bmp",140,130,0,12) MaskImage expl,255,0,255 MidHandle expl smoke = LoadAnimImage("gfxeffectssmoke.bmp",20,20,0,4) MaskImage smoke,255,0,255 MidHandle smoke smokenum = 1 slideimg = LoadImage("gfxeffectsslide.bmp") MaskImage slideimg,255,0,255 MidHandle slideimg light(1) = LoadImage("gfxeffectsfrontlight.bmp") light(2) = LoadImage("gfxeffectsacklight.bmp") light(3) = LoadImage("gfxeffectsacklight.bmp") light(4) = LoadImage("gfxeffectsfrontlight.bmp") For lightmask = 1 To 4 MaskImage light(lightmask),255,0,255 MidHandle light(lightmask) Next ;----------> Sounds crash = LoadSound("soundcrash.mp3") crash2 = LoadSound("soundcrash2.mp3") crash3 = LoadSound("soundcrash3.mp3") explosion = LoadSound("soundexplosion.mp3") engine = LoadSound("soundengine.mp3") slidesnd = LoadSound("soundslide.mp3") ;----------> loading_trafficpics For lt = 1 To trafficcountmax trafficpic(lt) = Rnd(1,9) Select trafficpic(lt) Case 1 trafficimg(lt) = LoadImage ("gfx raffic1.bmp") Case 2 trafficimg(lt) = LoadImage ("gfx raffic2.bmp") Case 3 trafficimg(lt) = LoadImage ("gfx raffic3.bmp") Case 4 trafficimg(lt) = LoadImage ("gfx raffic4.bmp") Case 5 trafficimg(lt) = LoadImage ("gfx raffic5.bmp") Case 6 trafficimg(lt) = LoadImage ("gfx raffic6.bmp") Case 7 trafficimg(lt) = LoadImage ("gfx raffic7.bmp") Case 8 trafficimg(lt) = LoadImage ("gfx raffic8.bmp") Case 9 trafficimg(lt) = LoadImage ("gfx raffic9.bmp") End Select MaskImage trafficimg(lt),255,0,255 Next bikecrashimg1 = LoadAnimImage("gfxikecrashcrash1.bmp",100,80,0,7) MaskImage bikecrashimg1,255,0,255 bikecrashimg2 = LoadAnimImage("gfxikecrashcrash2.bmp",100,80,0,7) MaskImage bikecrashimg2,255,0,255 ;----------> Random Variabel health = 100 Const maxspeed = 22 Const minspeed = -4 hyptire = Sqr(((0 - 22) ^ 2) + ((0 + 25) ^ 2)) hyplight = Sqr(((0 - 38) ^ 2) + ((0 + 13) ^ 2)) slidenum = 1 level = 1 ;#####################> ENDE DES LADENS UND DER DEKLARATION (ausser Sky !) <######################### .start trafficcount = Rnd(150,trafficcountmax) ;----------> Etappen_Namen Select level Case 1 route$ = "From Monaco to Zagreb" Case 2 route$ = "From Zagreb to Athen" Case 3 route$ = "From Athen to Instanbul" Case 4 route$ = "From Instanbul to Moskau" Case 5 route$ = "From Moskau to Helsinki" Case 6 route$ = "From Helsinki to Stockholm" Case 7 route$ = "From Scottland to London" End Select ;----> ### Sub Start ! ### Cls DrawImage load,0,0 Text 300,550,"Next Route : " + route If level <> 1 Then Text 280,570,leveltime$(level - 1) + " für die letzte Etappe" Flip ;------------------> Sky Images (LEVELBEDINGT !!!!) If detail = 1 For ls = 1 To 5 FreeImage sky1(ls) If level = 1 Or level = 4 Or level = 7 Then sky1(ls) = LoadImage("gfxskyklippe1.bmp") If level = 2 Or level = 3 Then sky1(ls) = LoadImage("gfxskykueste1.bmp") If level = 5 Or level = 6 Then sky1(ls) = LoadImage("gfxskyklippe3.jpg") MaskImage sky1(ls),255,0,255 Next For lr = 1 To 196 FreeImage rock(lr) If level = 1 Or level = 4 Or level = 7 Then rock(lr) = LoadImage("gfxskyklippe2.bmp") If level = 2 Or level = 3 Then rock(lr) = LoadImage("gfxskydust_sky2.bmp") If level = 5 Or level = 6 Then rock(lr) = LoadImage("gfxskyklippe4.jpg") MaskImage rock(lr),255,0,255 Next FreeImage finalbg If level = 1 Then finalbg = LoadImage("gfxskyfog2.bmp") If level = 4 Then finalbg = LoadImage("gfxskysee.bmp") If level = 7 Then finalbg = LoadImage("gfxskysee.bmp") If level = 1 Then sfcount = 400 If level = 5 Then sfcount = 150 For cf = 1 To sfcount If level = 5 Then sf(cf) = LoadImage("gfxskysnowflake.bmp") EndIf If level = 1 Then sf(cf) = LoadImage("gfxsky ain.bmp") EndIf MaskImage sf(cf),255,0,255 MidHandle sf(cf) Next EndIf ;-------------------> Car Startvariabeln xcar = 400 ycar = 450 winkel = 0 winkelplus = winkel Mod 4 winkel = winkel + winkelplus move# = 11 realposx = 0 realposy = 0 ;------------------> Levelbedingte Variablen If detail = 1 If level = 1 Or level = 4 Or level = 7 Then skyteiler = 5 xsky1 = 700 + realposx EndIf If level = 2 Or level = 3 Then skyteiler = 1 xsky1 = 580 + realposx EndIf If level = 5 Or level = 6 Then skyteiler = 1 xsky1 = 700 + realposx EndIf EndIf realposx = 210 ;--------> load_landscape If level = 1 Then mapfile = ReadFile("levelusermap1.map") If level = 2 Then mapfile = ReadFile("levelusermap2.map") If level = 3 Then mapfile = ReadFile("levelusermap3.map") If level = 4 Then mapfile = ReadFile("levelusermap4.map") If level = 5 Then mapfile = ReadFile("levelusermap5.map") If level = 6 Then mapfile = ReadFile("levelusermap6.map") If level = 7 Then mapfile = ReadFile("levelusermap7.map") If level = 8 Then mapfile = ReadFile("levelusermap8.map") If level = 9 Then mapfile = ReadFile("levelusermap9.map") If level = 10 Then mapfile = ReadFile("levelusermap10.map") If level = 11 Then mapfile = ReadFile("levelparacity.map") For c1 = 0 To 20 For c2 = 0 To 2000 bgtype(c1,c2) = ReadByte(mapfile) Next Next CloseFile mapfile For c5 = 0 To 500 Step 25 For c6 = 0 To 50000 Step 25 If bgtype(c5/25,c6/25) = 41 Then xcar = c5 + 210 realposy = -c6 + 240 EndIf Next Next ;--------> end load_landscape ;--------> create_traffic For ct = 1 To trafficcount trafficside(ct) = Rnd(1,3) If trafficside(ct) = 2 And trafficpic(ct) = 7 Then Repeat trafficside(ct) = Rnd(1,3) Until trafficside(ct) <> 2 EndIf Select trafficside(ct) Case 1 movetraffic(ct) = 14 xtraffic(ct) = 6*25 + 8 Case 2 movetraffic(ct) = 10 xtraffic(ct) = 9*25 + 8 Case 3 movetraffic(ct) = 6 xtraffic(ct) = 12*25 + 8 End Select ytraffic(ct) = Rnd(2000,48000) ;<<< Anfang und Ende des "Traffics" Next ;--------> proof_traffic Repeat ok = 0 For pt1 = 1 To trafficcount For pt2 = 1 To trafficcount If ytraffic(pt1) < ytraffic(pt2) And ytraffic(pt1) + 120 > ytraffic(pt2) Or ytraffic(pt1) < ytraffic(pt2) + 80 And ytraffic(pt1) + 120 > ytraffic(pt2) + 120 Then ytraffic(pt2) = Rnd(2000,48000) ok = 1 EndIf Next Next Until ok = 0 ;--------> create_sky If detail = 1 For cs = 1 To 5 ysky1(cs) = cs * 256 Next For cr = 1 To 196 yrock(cr) = cr * 256 Next ;-------> create_weather For cw = 1 To sfcount xsf(cw) = Rnd(120,800) ysf(cw) = Rnd(0,600) Next EndIf ;-------> restore Radio Volume ChannelVolume kanal666,vol# FlushKeys() ;--------------------------------------------------------------------------------------> ;########################## REPEAT CLS FLIP UNTIL SCHLEIFE ############################> ;--------------------------------------------------------------------------------------> Repeat Cls ;-------> FPS Messer If progstopint > 0 Then zeit = zeit + progstopint If zeit + 1000 < MilliSecs () Then zeit = MilliSecs () rfps = rfra rfra = 0 stopsec = stopsec + 1 ;STOPUHR !!! SEKUNDE !!! Else rfra = rfra + 1 EndIf If szeit + 1000 < MilliSecs () Then szeit = MilliSecs () sfps = sfra sfra = 0 Else sfra = sfra + 1 EndIf If rfps > 0 Then progstop# = (1000/30) - (1000/rfps) progstopint = progstop# If progstopint > 0 Then Delay progstopint ;-------> Attention ! If move# = 0 And slide = 0 Then ymove# = 0 ;-------> play_sound [(<<<] engineroam# = move# / maxspeed If move# > 0 Then ChannelVolume kanal2,engineroam# If ChannelPlaying(kanal2) = 0 Then kanal2 = PlaySound(engine) EndIf Else StopChannel kanal2 EndIf ;--------> car_collide_wall [123] For n2 = 0 To 500 Step 25 For o2 = 0 To 50000 Step 25 If bgtype (n2/25,o2/25) > 5 And bgtype (n2/25,o2/25) < 39 Then If ImagesCollide(background(5),n2 + realposx,o2 + realposy,0,carpic1(winkel),xcar,ycar,0) Then If xcar > 500 Then If winkel => 30 And winkel < 120 Or winkel => 240 And winkel < 330 Then slide = 4 xcar = xcar - 22 EndIf If winkel < 30 Or winkel => 330 Then xcar = xcar - 10 If slide = 4 Or slide = -4 Or slide = 2 Or slide = -2 Then slide = 0 Else winkel = 0 EndIf EndIf If winkel => 120 And winkel < 240 Then xcar = xcar - 15 winkel = 180 If slide = 4 Or slide = -4 Or slide = 2 Or slide = -2 Then slide = 0 Else winkel = 0 EndIf EndIf Else If winkel => 30 And winkel < 120 Or winkel => 240 And winkel < 330 Then slide = -4 xcar = xcar + 22 EndIf If winkel < 30 Or winkel => 330 Then xcar = xcar + 10 winkel = 0 If slide = 4 Or slide = -4 Or slide = 2 Or slide = -2 Then slide = 0 Else winkel = 0 EndIf EndIf If winkel => 120 And winkel < 240 Then xcar = xcar + 15 winkel = 180 If slide = 4 Or slide = -4 Or slide = 2 Or slide = -2 Then slide = 0 Else winkel = 0 EndIf EndIf EndIf EndIf EndIf Next Next ;--------> car_collide_traffic [123] For cct = 1 To trafficcount If ImagesCollide(carpic1(Winkel),xcar,ycar,0,trafficimg(cct),xtraffic(cct) + realposx,ytraffic(cct) + realposy,0) Then If ChannelPlaying(kanal1) = 0 Then If move# <= 6 Then kanal1 = PlaySound(crash3) If move# > 6 And move# <= 16 Then kanal1 = PlaySound(crash2) If move# > 16 Then kanal1 = PlaySound(crash) EndIf If ycar > ytraffic(cct) + realposy Then If xcar + 50 > xtraffic(cct) + realposx Or xcar < xtraffic(cct) + 50 + 3 Then savemove = move# move# = movetraffic(cct) - 2 If savemove > 12 Then movetraffic(cct) = movetraffic(cct) + 2 If winkel > 300 Or winkel <= 30 Then winkel = 0 If winkel <= 240 And winkel > 120 Then winkel = 180 If winkel <= 120 And winkel > 30 Then winkel = 88 If winkel <= 300 And winkel > 240 Then winkel = 268 health = health - 1 EndIf Else move# = movetraffic(cct) - 2 realposy = realposy + movetraffic(cct) If xcar > xtraffic(cct) + realposx Then If winkel <> 90 And winkel <> 270 Then winkel = winkel + 8 If trafficside(cct) = 2 Then xcar = xcar + 10 If trafficside(cct) = 1 Then xcar = xcar + 15 If trafficside(cct) = 3 Then xcar = xcar - 15 health = health - 1 EndIf If xcar <= xtraffic(cct) + realposx Then If winkel <> 90 And winkel <> 270 Then winkel = winkel - 8 If trafficside(cct) = 2 Then xcar = xcar - 10 If trafficside(cct) = 1 Then xcar = xcar + 15 If trafficside(cct) = 3 Then xcar = xcar - 15 health = health - 1 EndIf EndIf If trafficpic(cct) = 7 Then move# = 60 trafficimg(cct) = emptyimg If trafficside(cct) = 1 Then bikecrash = 1 ycrash = ytraffic(cct) Else bikecrash = 2 ycrash = ytraffic(cct) EndIf EndIf EndIf If winkel > 358 Then winkel = 0 If winkel < 0 Then winkel = 358 Next ;--------> car_slide [123] If slide <> 0 Then If ChannelPlaying(kanal4) = 0 Then kanal4 = PlaySound(slidesnd) Gosub slidestribe winkel = winkel + slide If winkel > 358 Then winkel = 0 If winkel < 0 Then winkel = 358 move# = 0 If ymove# > 1 Then ymove# = ymove# - 1 Else ymove# = 0 slide = 0 EndIf realposy = realposy + ymove# If slide > 0 Then xcar = xcar - 3 Else xcar = xcar + 3 EndIf EndIf If KeyDown(57) Then If KeyDown(203) And move# > 16 Then slide = -4 If KeyDown(205) And move# > 16 Then slide = 4 If KeyDown(203) And move# > 10 And move# <= 16 Then slide = -2 If KeyDown(205) And move# > 10 And move# <= 16 Then slide = 2 If move# > 0 Then move# = move# - 0.75 ;57 Leertaste Gosub slidestribe EndIf If move# > 0 And ChannelPlaying(kanal25) = 0 Then kanal25 = PlaySound(slidesnd) Else StopChannel kanal25 EndIf ;--------> sky_draw [#] If detail = 1 If level = 1 Or level = 4 Or level = 7 Then DrawImage finalbg,740,0 For sd = 1 To 5 If winkel > 270 Or winkel < 90 Then ysky1(sd) = ysky1(sd) + (ymove# / skyteiler) If ysky1(sd) > 600 Then ysky1(sd) = ysky1(sd) - (5 * 256) Else ysky1(sd) = ysky1(sd) + (ymove# / skyteiler) If ysky1(sd) < -256 Then ysky1(sd) = ysky1(sd) + (5 * 256) EndIf DrawImage sky1(sd),xsky1,ysky1(sd) Next EndIf ;--------> draw_landscape [#] For n = 0 To 500 Step 25 For o = 0 To 50000 Step 25 If n < 800 - realposx And n => -25 - realposx And o < 600 - realposy And o => -25 - realposy Then DrawImage background(bgtype(n/25,o/25)),realposx + n,realposy + o EndIf Next Next ;----------> Slidestripes [123] [#] For dslide = 1 To 59 yslide(dslide) = yslide(dslide) + ymove# DrawImage slideimg,xslide(dslide),yslide(dslide) Next ;----------> traffic_move [#] [123] For tm = 1 To trafficcount ytraffic(tm) = ytraffic(tm) - movetraffic(tm) If ytraffic(tm) < 0 Then ytraffic(tm) = 50000 If trafficside(tm) = 1 Then If movetraffic(tm) > 14 Then movetraffic(tm) = movetraffic(tm) - 2 Else movetraffic(tm) = 14 EndIf EndIf If trafficside(tm) = 2 Then If movetraffic(tm) > 10 Then movetraffic(tm) = movetraffic(tm) - 2 Else movetraffic(tm) = 10 EndIf EndIf If trafficside(tm) = 3 Then If movetraffic(tm) > 6 Then movetraffic(tm) = movetraffic(tm) - 2 Else movetraffic(tm) = 6 EndIf EndIf DrawImage trafficimg(tm),xtraffic(tm) + realposx,ytraffic(tm) + realposy Next ;------------> Crash the Mothafuckin Biker away ############################################# If bikecrash = 1 slowanicrash = slowanicrash + 1 If bikecrashani < 6 Then ycrash = ycrash - 14 DrawImage bikecrashimg1,318,ycrash + realposy,bikecrashani Else DrawImage bikecrashimg1,318,ycrash + realposy,bikecrashani bikecrashani = 0 bikecrash = 0 savecrash = savecrash + 1 savecrashside = 1 ycrashsave(savecrash) = ycrash EndIf If slowanicrash Mod 3 = 0 Then bikecrashani = (bikecrashani + 1) Mod 7 EndIf If bikecrash = 2 slowanicrash = slowanicrash + 1 If bikecrashani < 6 Then ycrash = ycrash - 16 DrawImage bikecrashimg2,522,ycrash + realposy,bikecrashani Else DrawImage bikecrashimg2,522,ycrash + realposy,bikecrashani bikecrashani = 0 bikecrash = 0 savecrash = savecrash + 1 savecrashside = 3 ycrashsave(savecrash) = ycrash EndIf If slowanicrash Mod 3 = 0 Then bikecrashani = (bikecrashani + 1) Mod 7 EndIf If savecrash > 0 Then For scd = 1 To savecrash If savecrashside = 1 Then DrawImage bikecrashimg1,318,ycrashsave(scd) + realposy,6 If savecrashside = 3 Then DrawImage bikecrashimg2,522,ycrashsave(scd) + realposy,6 Next EndIf ;------------> Brake & Accelation Smoke [#] winkeltire(1) = (ATan2(25,22)+ 450)Mod 360 winkeltire(2) = (ATan2(25,-22)+ 450)Mod 360 winkeltire(3) = (ATan2(-25,-22)+ 450)Mod 360 winkeltire(4) = (ATan2(-25,22)+ 450)Mod 360 For tc = 1 To 4 ytire(tc) = hyptire * Cos(winkeltire(tc) + Winkel) xtire(tc) = hyptire * Sin(winkeltire(tc) + Winkel) Next If KeyDown(200) Then If move# > 0 And move# < 6 Then If canplaysmokeslide = 0 Then kanal10 = PlaySound(slidesnd) canplaysmokeslide = 1 EndIf drawsmokecount = drawsmokecount + 1 If drawsmokecount Mod 2 = 0 Then smokenum = (smokenum + 2) Mod 40 xsmoke(smokenum) = xcar + xtire(1) ysmoke(smokenum) = ycar - ytire(1) smokeframe(smokenum) = 0 xsmoke(smokenum - 1) = xcar + xtire(2) ysmoke(smokenum - 1) = ycar - ytire(2) smokeframe(smokenum - 1) = 0 EndIf EndIf Else canplaysmokeslide = 0 EndIf For dsmoke = 1 To 39 If drawsmokecount Mod 5 = 0 Then smokeframe(dsmoke) = (smokeframe(dsmoke) + 1) Mod 4 ysmoke(dsmoke) = ysmoke(dsmoke) + ymove# + 3 xsmoke(dsmoke) = xsmoke(dsmoke) + 3 DrawImage smoke,xsmoke(dsmoke),ysmoke(dsmoke),smokeframe(dsmoke) Next ;-----------> car_move [#] [123] If slide = 0 If KeyDown(200) Then move# = move# + 0.5 ;200 = Pfeiltaste Oben If KeyDown(208) Then move# = move# - 0.25 ;208 Pfeiltaste Unten If move# > 0 Then move# = move# - 0.1 If move# < 0 Then move# = move# + 0.2 If move# > maxspeed Then move# = maxspeed If move# < minspeed Then move# = minspeed If KeyDown(203) And move# > 1 Then Winkel = Winkel - 2 ;203 = Pfeiltaste Links If KeyDown(205) And move# > 1 Then Winkel = Winkel + 2 ;205 = Pfeiltaste Rechts If KeyDown(203) And move# < 0 Then Winkel = Winkel + 2 ;203 = Pfeiltaste Links If KeyDown(205) And move# < 0 Then Winkel = Winkel - 2 ;205 = Pfeiltaste Rechts If Winkel < 0 Then Winkel = 358 If Winkel > 358 Then Winkel = 0 If move# > 0 Or move# < 0 Then xcar = xcar - Sin(0-winkel) * move# realposy = realposy + Cos(0-winkel) * move# ymove# = Cos(0-winkel) * move# EndIf EndIf If health > 0 Then DrawImage carpic1(Winkel),xcar,ycar EndIf ;------------> car_lights [#] If KeyHit(38) Then lighton = (lighton + 1) Mod 2 If lighton = 1 Or KeyDown(57) Or KeyDown(208) Then winkellight(1) = (ATan2(13,38)+ 360)Mod 360 winkellight(2) = (ATan2(13,-38)+ 360)Mod 360 winkellight(3) = (ATan2(-13,-38)+ 360)Mod 360 winkellight(4) = (ATan2(-13,38)+ 360)Mod 360 If KeyDown (57) Or KeyDown(208) Then If lighton = 0 Then wlmin = 2 wlmax = 3 Else wlmin = 1 wlmax = 4 EndIf Else wlmin = 1 wlmax = 4 EndIf For lo = wlmin To wlmax ylight(lo) = hyplight * Cos(winkellight(lo) + Winkel) xlight(lo) = hyplight * Sin(winkellight(lo) + Winkel) DrawImage light(lo),xcar + xlight(lo), ycar - ylight(lo) Next EndIf ;------------> rock_draw [#] If detail = 1 xrock = realposx - 100 For rd = 1 To 196 If yrock(rd) + realposy > - 255 And yrock(rd) + realposy < 600 Then DrawImage rock(rd),xrock,yrock(rd) + realposy Next EndIf ;------------> weather_draw [#] If detail = 1 If level = 1 Or level = 5 Then For wd = 1 To sfcount xsf(wd) = xsf(wd) + 6 ysf(wd) = ysf(wd) + 6 + ymove# If xsf(wd) > 800 Or ysf(wd) > 600 Then cssf = Rnd(1,3) If cssf = 3 Then ysf(wd) = Rnd(0,600) xsf(wd) = 120 Else xsf(wd) = Rnd(120,800) ysf(wd) = 0 EndIf EndIf DrawImage sf(wd),xsf(wd),ysf(wd) Next EndIf EndIf ;------------> StopUhr [123] If iro = 1 Then milliplus = MilliSecs() - savemilli savemilli = MilliSecs() milli = (milli + milliplus) Mod 1000 iro = 1 ;------------> hud_draw [#] entfernung = realposy / (-100) tachowinkel = ( move# * 10 ) - ((move# * 10) Mod 5) If move# < 0 Then tachowinkel = 0 DrawImage tachobg2,0,0 DrawImage tachobg3,0,100 DrawImage tachobg,100,50 DrawImage tacho(tachowinkel),100,50 If health > 90 Then DrawImage damage(1),12,110 If health <= 90 And health > 70 Then DrawImage damage(2),12,110 If health <= 70 And health > 50 Then DrawImage damage(3),12,110 If health <= 50 And health > 30 Then DrawImage damage(4),12,110 If health <= 30 And health > 10 Then DrawImage damage(5),12,110 If health <= 10 Then DrawImage damage(6),12,110 DrawImage overcar,12,110 Color 220,0,0 Text 92,67,health + "% HP" Text 92,81,entfernung +" km" Color 255,255,255 ;Text 5,220,winkel ;Text 5,240,bikecrashani ;Text 5,260,ycrash Text 5,300,"RealFPS : " + rfps Text 5,320,"StopFPS : " + sfps If gnarf = 1 Then Text 5,340,"HAAAAAAAAAAAAAAAAAAAAALLLLLLLLLLLLLLLOOOOOOOOOOOOOOOOOOO" Text 5,360,stopsec + "." + milli Text 5,380,"Anzahl Autos" Text 5,400,">>> " + trafficcount Include "radio.bb" ;-------> screen_shot [#] If KeyHit(31) Then GrabImage screenshot,0,0 SaveImage screenshot,"screenshot.bmp" EndIf ;-------> map_goal & explosion / health tester [123] If realposy > -310 Then gameover = 2 EndIf If health < 1 Then If explrate < 12 Then If expyes = 0 Then kanal3 = PlaySound(explosion) DrawImage expl,xcar + 20,ycar + 40,explrate explrate = explrate + 1 expyes = 1 Else Delay 3000 gameover = 1 EndIf EndIf If KeyHit(35) Then Gosub hitlist Flip Until KeyHit(1) Or gameover > 0 ;------------------------------------------------------------------------------------------------> ;################################## ENDE FLIP SCHLEIFE ##########################################> ;------------------------------------------------------------------------------------------------> If vol# > 0.2 Then ChannelVolume kanal666,0.2 StopChannel kanal2 savecrash = 0 realposx = 0 realposy = 0 move# = 0 health = health + 15 If health > 100 Then health = 100 leveltime$(level) = stopsec + "." + milli +" Sekunden" levelsec(level) = stopsec levelmilli(level) = milli stopsec = 0 milli = 0 If gameover = 0 Then End If gameover = 1 Then Repeat Cls DrawImage load,0,0 Text 350,580,"< PRESS ESC KEY TO QUIT >" Flip Until KeyHit(1) WaitKey End EndIf If gameover = 2 Then FlushKeys() level = level + 1 gameover = 0 If level = 8 Then Gosub hitlist Repeat Cls DrawImage load,0,0 Text 350,580,"< PRESS SPACE KEY TO CONTINUE >" Flip Until KeyHit(57) WaitKey Gosub start EndIf .hitlist FlushKeys For addlvltime = 1 To 7 stopsecadd = stopsecadd + levelsec(addlvltime) stopmilliadd = stopmilliadd + levelmilli(addlvltime) Next addtosec = stopmilliadd / 1000 stopmilliadd = stopmilliadd Mod 1000 endtime$ = stopsecadd + "." + stopmilliadd endtimedb# = endtime$ Cls Text 200,50,"Sie brauchten für alle 7 Etappen : " + endtime$ + " Sekunden !!!" file2 = ReadFile("hitlist.txt") If Not file2 Then RuntimeError "File not found" For rhl = 1 To 10 hitlistname$(rhl) = ReadLine(file2) hitlistnum#(rhl) = ReadLine(file2) Next CloseFile file2 For scanhl = 1 To 10 temp$(scanhl) = hitlistnum#(scanhl) tempname$(scanhl) = hitlistname$(scanhl) If endtimedb# < hitlistnum#(scanhl) Then For godown = scanhl To 10 If godown > 1 Then temp$(godown) = hitlistnum#(godown - 1) tempname$(godown) = hitlistname$(godown - 1) EndIf Next If placefound = 0 Then temp$(scanhl) = endtimedb# tempname$(scanhl) = username$ placefound = 1 EndIf EndIf Next file3 = WriteFile("hitlist.txt") If Not file3 Then RuntimeError "File not found" For createnewlist = 1 To 10 hitlistnum#(createnewlist) = temp$(createnewlist) hitlistname$(createnewlist) = tempname$(createnewlist) Text 200,100 + (createnewlist * 20),hitlistname$(createnewlist) + " > " + hitlistnum(createnewlist) + " Sek" WriteLine file3,hitlistname$(createnewlist) WriteLine file3,hitlistnum#(createnewlist) Next Flip CloseFile file3 WaitKey Gosub thanks .thanks For gtext = 600 To 1092 Step 12 textnum((gtext-600)/12) = gtext Next Repeat For ctext = 1 To 41 textnum(ctext) = textnum(ctext) - 2 If textnum(ctext) < 100 Then textnum(ctext) = textnum(ctext) + 500 Next Cls Color 200,0,0 Text 10,textnum(1),"For Graphics and new Ideas :" Text 10,textnum(2),"############################" Text 10,textnum(3),"" Text 10,textnum(4),"- get_lose" Text 10,textnum(5),"- $ave alias SxV" Text 10,textnum(6),"" Text 10,textnum(7),"For Betatesting :" Text 10,textnum(8),"#################" Text 10,textnum(9),"" Text 10,textnum(10),"- Sven alias WellLikedAssman" Text 10,textnum(11),"- Andy alias SantaClaus" Text 10,textnum(12),"- Caro <3" Text 10,textnum(13),"- $ave alias SxV" Text 10,textnum(14),"- Markus alias ViCA" Text 10,textnum(15),"- Christoph alias RoaDie" Text 10,textnum(16),"- Max alias Max *g*" Text 10,textnum(17),"- Robert alias Scr33m" Text 10,textnum(18),"- get_lose" Text 10,textnum(19),"- M@tzM@n" Text 10,textnum(20),"- theBlade" Text 10,textnum(21),"- Devastator alias Vulture" Text 10,textnum(22),"- mangoo" Text 10,textnum(23),"- Brainstorm" Text 10,textnum(24),"" Text 10,textnum(25),"Random other Thanks :" Text 10,textnum(26),"#####################" Text 10,textnum(27),"" Text 10,textnum(28),"- BlitzForum.de for a lot of help" Text 10,textnum(29),"- Blitz Community for the Feedback" Text 10,textnum(30),"- RobSite.de for a very good Blitz2d Tut." Text 10,textnum(31),"- Cigaretts by West *g*" Text 10,textnum(32),"- Do it yourself - Icetea -> the best drink" Text 10,textnum(33)," for a hard programming day =)" Text 10,textnum(34),"- My Girlfriend , because she understands" Text 10,textnum(35)," that there are also other things than" Text 10,textnum(36)," or love =) thanks for Feedback Caro *g*" Text 10,textnum(37),"- If I have forgot anybody please tell me ..." Text 10,textnum(38)," I will add you" Text 10,textnum(39),"" Text 10,textnum(40)," < Press Esc Key for quit >" Text 10,textnum(41),"" banner = LoadImage("gfxmenu hanks.jpg") DrawImage banner,0,0 Flip Until KeyHit(1) WaitKey End ;------------> ### SUB Slidestripes !!!! .slidestribe xslide(slidenum) = xcar + xtire(1) yslide(slidenum) = ycar - ytire(1) xslide(slidenum + 1) = xcar + xtire(2) yslide(slidenum + 1) = ycar - ytire(2) xslide(slidenum + 2) = xcar + xtire(3) yslide(slidenum + 2) = ycar - ytire(3) xslide(slidenum + 3) = xcar + xtire(4) yslide(slidenum + 3) = ycar - ytire(4) slidenum = slidenum + 4 If slidenum = 81 Then slidenum = 1 Return[/code:1:aa0fc5b277] [u:aa0fc5b277][b:aa0fc5b277]DER CODE FÜR DIE HITLIST[/b:aa0fc5b277][/u:aa0fc5b277] [code:1:aa0fc5b277]Graphics 800,600,16,1 SetBuffer BackBuffer() Dim hitlistnum#(10) Dim hitlistname$(10) Dim temp$(10) Dim tempname$(10) Dim leveltime$(7) Dim levelsec(7) Dim levelmilli(7) .hitlist FlushKeys For addlvltime = 1 To 7 stopsecadd = stopsecadd + levelsec(addlvltime) stopmilliadd = stopmilliadd + levelmilli(addlvltime) Next addtosec = stopmilliadd / 1000 stopmilliadd = stopmilliadd Mod 1000 endtime$ = stopsecadd + "." + stopmilliadd endtimedb# = endtime$ Cls Text 200,50,"Sie brauchten für alle 7 Etappen : " + endtime$ + " Sekunden !!!" file2 = ReadFile("hitlist.txt") If Not file2 Then RuntimeError "File not found" For rhl = 1 To 10 hitlistname$(rhl) = ReadLine(file2) hitlistnum#(rhl) = ReadLine(file2) Next CloseFile file2 For scanhl = 1 To 10 temp$(scanhl) = hitlistnum#(scanhl) tempname$(scanhl) = hitlistname$(scanhl) If endtimedb# < hitlistnum#(scanhl) Then For godown = scanhl To 10 If godown > 1 Then temp$(godown) = hitlistnum#(godown - 1) tempname$(godown) = hitlistname$(godown - 1) EndIf Next If placefound = 0 Then temp$(scanhl) = endtimedb# tempname$(scanhl) = username$ placefound = 1 EndIf EndIf Next file3 = WriteFile("hitlist.txt") If Not file3 Then RuntimeError "File not found" For createnewlist = 1 To 10 hitlistnum#(createnewlist) = temp$(createnewlist) hitlistname$(createnewlist) = tempname$(createnewlist) Text 200,100 + (createnewlist * 20),hitlistname$(createnewlist) + " > " + hitlistnum(createnewlist) + " Sek" WriteLine file3,hitlistname$(createnewlist) WriteLine file3,hitlistnum#(createnewlist) Next Flip CloseFile file3 WaitKey[/code:1:aa0fc5b277] [u:aa0fc5b277][b:aa0fc5b277]DAS MAIN MENUE[/b:aa0fc5b277][/u:aa0fc5b277] [code:1:aa0fc5b277]Dim choosecar(10) Dim carname$(10) Dim highspeed$(10) Dim acce$(10) Dim editor$(10) bg = LoadImage("gfxmenug.jpg") globe = LoadImage("gfxmenuglobus.bmp") MaskImage globe,255,0,255 pipe1 = LoadImage("gfxmenupipes1.bmp") MaskImage pipe1,255,0,255 pipe2 = LoadImage("gfxmenupipes2.bmp") MaskImage pipe2,255,0,255 bt1 = LoadImage("gfxmenuutton1.bmp") MaskImage bt1,255,0,255 bt2 = LoadImage("gfxmenuutton2.bmp") MaskImage bt2,255,0,255 bt3 = LoadImage("gfxmenuutton3.bmp") MaskImage bt3,255,0,255 balken1 = LoadImage("gfxmenualken.bmp") balken2 = LoadImage("gfxmenualkenwin.bmp") leftbtn = LoadImage("gfxmenuleft.bmp") MaskImage leftbtn,255,0,255 rightbtn = LoadImage("gfxmenu ight.bmp") MaskImage rightbtn,255,0,255 gobtn = LoadImage("gfxmenugobtn.bmp") choosebox = LoadImage("gfxmenuchoosebox.bmp") choosecar(1) = LoadImage("gfxcar1.bmp") MaskImage choosecar(1),255,0,255 choosecar(2) = LoadImage("gfxcar2.bmp") MaskImage choosecar(2),255,0,255 cartype = 1 xpipe = 375 ypipe = 240 bt1scroll = 10 bt2scroll = 440 bt3scroll = 515 balkenscroll = 601 carname$(1) = "Helby Zobra" carname$(2) = "Porche´" highspeed$(1) = "220" highspeed$(2) = "220" acce$(1) = "k/a" acce$(2) = "k/a" editor$(1) = "j0k3" editor$(2) = "Fux" mouseimg = LoadImage("gfxmenumouse.bmp") MaskImage mouseimg,255,0,255 MidHandle mouseimg Repeat Cls DrawImage bg,0,0 DrawImage pipe1,xpipe,0 DrawImage pipe2,0,ypipe DrawImage balken1,xpipe + 50,balkenscroll DrawImage balken2,xpipe + 297,balkenscroll DrawImage balken1,xpipe + 697,balkenscroll DrawImage bt1,xpipe - 25,bt1scroll DrawImage bt2,xpipe - 25,bt2scroll DrawImage bt3,xpipe - 25,bt3scroll DrawImage globe,xpipe - 150,ypipe - 140 If ImagesOverlap(bt1,xpipe - 25,10,mouseimg,MouseX(),MouseY()) Then If MouseHit(1) Then startgame = 1 EndIf If ImagesOverlap(bt2,xpipe - 25,512,mouseimg,MouseX(),MouseY()) Then If MouseHit(1) Then goon = 2 EndIf If startgame = 1 Then If xpipe > -26 Then xpipe = xpipe - 4 Else fertig = 1 EndIf If ypipe > -27 Then ypipe = ypipe - 3 If bt1scroll > -100 Then bt1scroll = bt1scroll - 4 If bt2scroll < 600 Then bt2scroll = bt2scroll + 4 If bt3scroll < 600 Then bt3scroll = bt3scroll + 4 If balkenscroll > 275 Then balkenscroll = balkenscroll - 3 EndIf If fertig = 1 Then DrawImage leftbtn,245,305 DrawImage rightbtn,650,305 DrawImage choosebox,300,300 DrawImage choosecar(cartype),305,305 DrawImage gobtn,100,320 Color 180,0,0 Text 400,300,"Cartype : " + carname$(cartype) Text 400,320,"Speed : " + highspeed$(cartype) Text 400,340,"Beschleunigung : " + acce$(cartype) Text 400,360,"Editor : " + editor$(cartype) If ImagesOverlap(leftbtn,245,305,mouseimg,MouseX(),MouseY()) Then If MouseHit(1) Then cartype = cartype - 1 EndIf If ImagesOverlap(rightbtn,650,305,mouseimg,MouseX(),MouseY()) Then If MouseHit(1) Then cartype = cartype + 1 EndIf If ImagesOverlap(gobtn,100,320,mouseimg,MouseX(),MouseY()) Then If MouseHit(1) Then goon = 1 EndIf If cartype = 3 Then cartype = 1 If cartype = 0 Then cartype = 2 EndIf DrawImage mouseimg,MouseX(),MouseY() FlushMouse() Flip ;300-28,300-26 Until KeyHit(1) Or goon = 1 Or goon = 2 FreeImage bg FreeImage globe FreeImage pipe1 FreeImage pipe2 FreeImage btn1 FreeImage btn2 FreeImage btn3 FreeImage balken1 FreeImage balken2 FreeImage leftbtn FreeImage rightbtn FreeImage gobtn FreeImage choosebox FreeImage choosecar(1) FreeImage choosecar(2) FreeImage mouseimg If goon <> 1 Then End load = LoadImage("gfxmenuload.jpg") Cls DrawImage load,0,0 Flip[/code:1:aa0fc5b277] [b:aa0fc5b277][u:aa0fc5b277]DIE MP3 LOAD ANALYSE[/u:aa0fc5b277][/b:aa0fc5b277] [code:1:aa0fc5b277]mp3ver = ReadDir("radio") Repeat dateiname$ = Lower$(NextFile$(mp3ver)) If Instr(dateiname$,".mp3")>0 Then Print "Hab "+dateiname$+" gefunden" If dateiname$="" Then Exit Forever WaitKey()[/code:1:aa0fc5b277] [u:aa0fc5b277][b:aa0fc5b277]DAS MP3 RADIO[/b:aa0fc5b277][/u:aa0fc5b277] [code:1:aa0fc5b277]If KeyHit(19) Then radiooff = (radiooff + 1) Mod 2 If radiooff = 0 And trackanzahl > 0 Then visanim = (visanim + 1) Mod 15 DrawImage radiobg,0,450 If visanim Mod 5 = 0 Then DrawImage rdvisual,26,528,visanim / 5 Else DrawImage rdvisual,26,528,(visanim - (visanim Mod 5))/5 EndIf If ChannelPlaying(kanal666) = 0 Then mp3track = Rnd(1,trackanzahl) kanal666 = PlaySound(mp3(mp3track)) showtrack = 1 showtime = 0 EndIf If KeyDown(20) And vol# > 0.01 Then vol = vol -0.01 ChannelVolume kanal666,vol# EndIf If KeyDown(21) And vol# < 0.99 Then vol = vol + 0.01 ChannelVolume kanal666,vol# EndIf showvol = vol# * 100 Color 240,0,0 Text 92,528,"Vol " + showvol + "%" If showtrack = 1 And showtime < 150 Then showtime = showtime + 1 DrawImage rdmsg,200,0 Text 235,11,mp3name$(mp3track) EndIf Color 255,255,255 Else StopChannel kanal666 EndIf[/code:1:aa0fc5b277] |
... von ??? |
:lol: Da hat der Ojay vollkommen recht, eine Download Version mit Sourc eund allen Dateien wäre nicht schlecht. bye |
von ??? |
@ Suco-X & O-Jay das Spiel gibts schon lange (aber schmeichelt mir das ihrs nit kennt :cry: : [url]http://www.aballrace.de.vu[/url] DL the Source Code ( Bilder + Sounds sind im Spiel auf der Seite enthalten ) [url]http://home.arcor.de/dukowald/sourcecode_abr.zip[/url] |
von ??? |
ja gehört schon, da war doch der code weg, oder sowas, ne? :lol: werds zuhause mal testen ;) ädit: aso ist das...na dann ^^ ich dachte erst, es gäbe NUR die opensource version [img:8f13e180cb]http://www.my-smileys.de/megagrin.gif[/img:8f13e180cb] |