machs doch so:
(soll nur ne anregung sein; nix kopieren )
BlitzBasic: [AUSKLAPPEN] [EINKLAPPEN] Graphics 1024,768 SetBuffer BackBuffer() Global maxBatPlayer=2 Global erworbeneexp=0 Global maxBatEnemies=3 Global maxskills=5 Dim BatPlayer$(maxBatPlayer+1,20) Dim BatEnemies$(maxBatEnemies,20) Dim Skill$(maxskills) Dim GeneralDim(100) Skill(1)=\"Doppelhieb\" Skill(2)=\"Blitzschlag\" Skill(3)=\"Erosion\" Skill(4)=\"Schwertwurf\" Skill(5)=\"Feuerhagel\" Battle(\"121\")
Function Battle(st$) BatPlayer$(1,0)=\"Algavo\" BatPlayer$(1,1)=100 BatPlayer$(1,3)=20 BatPlayer$(1,5)=17 BatPlayer$(2,0)=\"Kristin\" BatPlayer$(2,1)=150 BatPlayer$(2,3)=10 BatPlayer$(2,5)=17 For i=1 To Len(st$) Select Int(Mid$(st$,i,1)) Case 1 BatEnemies(i,0)=\"Fledermaus\" BatEnemies(i,1)=30 BatEnemies(i,3)=14 BatEnemies(i,4)=7 BatEnemies(i,5)=4 BatEnemies(i,7)=GExp(i) Case 2 BatEnemies(i,0)=\"Spinne\" BatEnemies(i,1)=100 BatEnemies(i,2)=10 BatEnemies(i,3)=10 BatEnemies(i,4)=10 BatEnemies(i,5)=13 BatEnemies(i,7)=GExp(i) End Select BatEnemies(i,8)=1 Next x=5 y=660 hght=100 Repeat For i=1 To maxBatPlayer+1 BatPlayer(i,2)=0 Next choose=1 choose2=1 choose3=1 choose4=1 choose5=1 Repeat Cls If KeyHit(200) Then choose=choose-1 If KeyHit(208) Then choose=choose+1 If KeyHit(1) Then End If KeyHit(28) Then Exit Select choose Case 0 choose=3 Case 1 Text x,y,\">\" Case 2 Text x,y+20,\">\" Case 3 Text x,y+40,\">\" Case 4 choose=1 End Select Text x+30,y,\"Kampf\" Text x+30,y+20,\"Autokampf\" Text x+30,y+40,\"Flucht\" Rect x-5,y-5,120,hght,0 DrawEnemies() Flip Forever newrect=0 choose2=1 Select choose Case 1 Repeat Cls If KeyHit(200) Then choose2=choose2-1 If KeyHit(208) Then choose2=choose2+1 Select choose2 Case 0 choose2=maxBatPlayer+1 Case maxBatPlayer+2 choose2=1 End Select If KeyHit(1) Then End If KeyHit(28) And BatPlayer(choose2,2)<>1 Then Select choose2 Case maxBatPlayer+1 Exit End Select BatPlayer(choose2,2)=1 Repeat Cls If KeyHit(200) Then choose3=choose3-1 If KeyHit(208) Then choose3=choose3+1 If KeyHit(1) Then End If KeyHit(28) Then Exit Select choose Case 0 choose=3 Case 1 Text x,y,\">\" Case 2 Text x,y+20,\">\" Case 3 Text x,y+40,\">\" Case 4 choose=1 End Select Text x+30,y,\"Kampf\" Text x+30,y+20,\"Autokampf\" Text x+30,y+40,\"Flucht\" Rect x-5,y-5,120,hght,0 Viewport x+114,y-5,newrect,hght Text 230,80+choose2*20,\">\" For i=1 To maxBatPlayer Color 255,255,255 If BatPlayer(i,2) Then Color 128,128,128 Text x+135,y-20+i*20,BatPlayer$(i,0)+\" (LP:\"+BatPlayer(i,1)+\")\" Next Color 255,255,255 Rect x+114,y-5,newrect,hght,0 Viewport x+414,y-5,newrect2,hght If newrect2<120 Then newrect2=newrect2+3 End If Select choose3 Case 0 choose3=3 Case 1 Text x+420,y,\">\" Case 2 Text x+420,y+20,\">\" Case 3 Text x+420,y+40,\">\" Case 4 choose3=1 End Select Rect x+414,y-5,newrect2,hght,0 Text x+430,y,\"Angriff\" Text x+430,y+20,\"Fähigkeit\" Text x+430,y+40,\"Item\" Viewport 0,0,GraphicsWidth(),GraphicsHeight() DrawEnemies() Flip Forever Select choose3 Case 1 Repeat Cls d=0 u=0 If KeyHit(200) Then choose4=choose4-1:d=1 If KeyHit(208) Then choose4=choose4+1:u=1 If KeyHit(28) Then Exit Repeat Select choose4 Case 0 choose4=maxBatEnemies Case maxBatEnemies+1 choose4=1 Case choose4*(BatEnemies(choose4,8)=0) choose4=choose4-d+u Default d=0:u=0 End Select Until d=0 And u=0 If BatEnemies(choose4,8)=0 Then For a=1 To Len(st$) If BatEnemies(a,8)=1 Then Exit Next choose4=a End If DrawEnemies() Color 255,0,0 DrawEnemy(choose4) Color 255,255,255 Flip Forever wdif=Int(BatPlayer(choose2,5))-Int(BatEnemies(choose4,5)) dif=Int(BatPlayer(choose2,3))-Int(BatEnemies(choose4,4))+Rand(1,wdif) If dif>0 Then BatEnemies(choose4,1)=Int(BatEnemies(choose4,1))-dif txt$=(\"-\"+dif) Else txt$=\"0\" End If they=0 thex=0 Repeat Cls If timer<MilliSecs()-100 Then timer=MilliSecs() they=they-1 End If DrawEnemies() Color 255,0,0 DrawEnemy choose4 Text 50+choose4*150,100+((choose4*80) Mod 60)+they*3 ,txt$ Color 255,255,255 Flip Until they=-20 Case 2 Repeat Cls If KeyHit(203) Then choose5=choose5-1 If KeyHit(205) Then choose5=choose5+1 If KeyHit(28) Then Exit If KeyHit(1) Then End Select choose5 Case 0 choose5=maxskills Case maxskills+1 choose5=1 End Select Rect 442,354,140,40,0 Text 512,384,\"<-\"+Skill(choose5)+\"->\",1,1 DrawEnemies Flip Forever angriff=0 Select choose5 Case 1 zusangriff=27 Case 2 zusangriff=33 Case 3 zusangriff=25 Case 4 zusangriff=35 Case 5 zusangriff=29 End Select Select choose5 Case 3,5 For i=1 To maxBatEnemies angriff=zusangriff+Rand(6)+Int(BatPlayer(choose2,5))-Int(BatEnemies(i,5)) If angriff>0 Then BatEnemies(i,1)=Int(BatEnemies(i,1))-angriff End If Next Default Repeat Cls d=0 u=0 If KeyHit(200) Then choose4=choose4-1:d=1 If KeyHit(208) Then choose4=choose4+1:u=1 If KeyHit(28) Then Exit Repeat Select choose4 Case 0 choose4=maxBatEnemies Case maxBatEnemies+1 choose4=1 Case choose4*(BatEnemies(choose4,8)=0) choose4=choose4-d+u Default d=0:u=0 End Select Until d=0 And u=0 If BatEnemies(choose4,8)=0 Then For a=1 To Len(st$) If BatEnemies(a,8)=1 Then Exit Next choose4=a End If DrawEnemies() Color 255,0,0 DrawEnemy(choose4) Color 255,255,255 Flip Forever Select choose5 Case 1 angriff=zusangriff+Rand(6)+Int(BatPlayer(choose2,5))-Int(BatEnemies(choose4,5)) If angriff>0 Then BatEnemies(choose4,1)=Int(BatEnemies(choose4,1))-angriff End If End Select End Select Case 3 End Select End If Select choose Case 0 choose=4 Case 1 Text x,y,\">\" Case 2 Text x,y+20,\">\" Case 3 Text x,y+40,\">\" Case 5 choose=1 End Select Text x+30,y,\"Kampf\" Text x+30,y+20,\"Autokampf\" Text x+30,y+40,\"Flucht\" Rect x-5,y-5,120,hght,0 If newrect<300 Then newrect=newrect+3 Else End If Viewport x+114,y-5,newrect,hght Text x+125,y-20+choose2*20,\">\" For i=1 To maxBatPlayer Color 255,255,255 If BatPlayer(i,2) Then Color 128,128,128 Text x+135,y-20+i*20,BatPlayer$(i,0)+\" (LP:\"+BatPlayer(i,1)+\")\" Next Color 255,255,255 Text x+135,y-20+i*20,\"Zug beenden...\" Rect x+114,y-5,newrect,hght,0 Viewport 0,0,GraphicsWidth(),GraphicsHeight() DrawEnemies() Flip Forever Case 2 Case 3 End Select Forever Return erworbeneexp End Function Function DrawEnemies() For i=1 To maxBatEnemies DrawEnemy(i) Next End Function Function DrawEnemy(i) If BatEnemies(i,8) Then Text 50+i*150,100+(i*80) Mod 60,BatEnemies(i,0)+\"(\"+BatEnemies(i,1)+\")\" If BatEnemies(i,1)<1 Then BatEnemies(i,8)=0 End If End If End Function Function GExp(i) Return Int(Float((Int(BatEnemies(i,1))/10))*Float((Int(BatEnemies(i,3))/10))*Float((Int(BatEnemies(i,4))/10))*Float(Int(BatEnemies(i,5)))) End Function
Nur 331 Zeilen...hoffentlich nich zuviel
|