Ein Goschoss von der Position des Players aus starten lassen

Übersicht BlitzBasic Allgemein

Gehe zu Seite 1, 2  Weiter

Neue Antwort erstellen

 

sven123

Betreff: Ein Goschoss von der Position des Players aus starten lassen

BeitragSa, Jan 03, 2004 21:02
Antworten mit Zitat
Benutzer-Profile anzeigen
Nun ich habe ein ziemlich simpeles Problem!Aber ich komme von alleine nicht auf die Lösung,ich benödige dringen einen denkprozess anregenden Virituellen schlag auf den Hinterkopf Laughing Also nun zum Problem ich habe eine Spieligur mit den Koordinaten x,y diese Spielfigur wird vom Spieler durch die Curser Tasten nach Links und nach Rechts gesteuert,jetzt soll eine Rakete abgeschossen vom spieler durch das Level fliegen allerdings ist die Startposition der Rakete die der Spielfigur.
Hier mal einen kleinen Pseudocode wie ich dasa Problem lösen wollte

drawimage player,x,y
;Hier wir über keydown die Posi des Players verändert
if (Bedingung) then
drawimage rakete,x,y
y=y+2
endif
Jetzt wird die Rakete immer von der Aktuellen Position des Spielers gestartet doch jetzt habe ich das Problem das die Spielfigur mit derRakete nach unten fliegt das soll aber ja gerade nich geschehen,es soll sich ja nur die Rakete vom Startpunkt wegbewegen.Ich hoffe ihr könnt mir Helfen.
Amd Athlon 2200+,Saphire Atlantis Radeon9800pro,1024 MB DDR RAm,40 Gb Festblatte.
'in shâ'a llâh=so Gott will
Fertiges Projekt:Invasion der Heuschrecken

DC

Sieger des B2D Retro Wettbewerb / Aug 04

BeitragSa, Jan 03, 2004 21:21
Antworten mit Zitat
Benutzer-Profile anzeigen
Du musst für die Rakete nochmal eigene Variablen verwenden. Wenn du viele Objete hast sind auch Arrays (DIM) oder Types eine gute Wahl.
Core i5 4670K | 4 x 3,40 GHZ | 16 GB Ram | GeForce GTX 960 | HTC Vive | Win 10 Pro
www.UnrealSoftware.de | www.StrandedOnline.de | www.CS2D.com |
www.CarnageContest.com | www.Stranded3.com
 

newkev

BeitragSa, Jan 03, 2004 21:38
Antworten mit Zitat
Benutzer-Profile anzeigen
drawimage player,x,y
;Hier wir über keydown die Posi des Players verändert
if (Bedingung) then
raketex = playerx
raketey = playery
drawimage rakete,x,y
y=y+2
endif
Signatur? Gibts nich^^

Rallimen

Sieger des 30-EUR-Wettbewerbs

BeitragSo, Jan 04, 2004 3:09
Antworten mit Zitat
Benutzer-Profile anzeigen
falls du speziellen Code brauchst der einfach zu verstehen ist und leicht zu erweitern ohne kopfzerbrechglühformeln hab ich da noch 1-2!
wenn intresse besteht >>>>einfach bescheid geben, dann kannste die 2 Standardcodes haben um diese dann zu erweitern !!!
natürlich in Dim, da ich mich um Typs noch immer drücken konnte Very Happy
[BB2D | BB3D | BB+]

Hubsi

BeitragSo, Jan 04, 2004 11:48
Antworten mit Zitat
Benutzer-Profile anzeigen
Code: [AUSKLAPPEN]
drawimage rakete,raketex,raketey ;
raketey=raketey+2                      ; So funktionierts besser :)
Den ganzen Doag im Bett umanandflagga und iaz daherkema und meine Hendl`n fressn...
 

sven123

BeitragSo, Jan 04, 2004 12:41
Antworten mit Zitat
Benutzer-Profile anzeigen
Jo wäre ganz net wenn du mir an Paar standart Programme geben könntest!!!!!!!!!!!!!!11111111 Embarassed
Amd Athlon 2200+,Saphire Atlantis Radeon9800pro,1024 MB DDR RAm,40 Gb Festblatte.
'in shâ'a llâh=so Gott will
Fertiges Projekt:Invasion der Heuschrecken
 

sven123

BeitragSo, Jan 04, 2004 13:42
Antworten mit Zitat
Benutzer-Profile anzeigen
Hier habe ich jetzt ein kleinen code ausschnitt damir fliegt die Rakete auch ordnungsgemäße und sie Startet auch immer von der Aktuellen Position des Players.Doch jetzt habe ich ein anderes Problem wenn die Rakete eine bestimmte Position ereicht soll das Programm zum Test 5 sekunden stoppen,dass funktioniert allerdings nicht.Hier der code:
Code: [AUSKLAPPEN]
;Schusstest
If KeyDown(157)  Then
Kanone(kan,0)=x
Kanone(kan,1)=y
Kanone(kan,2)=1
EndIf
;Extras
;Kanone am Padel
If Kanone(kan,2)=1 Then
For kan=0 To 0
DrawImage Kanonenkugel,Kanone(kan,0),Kanone(kan,1)
Kanone(kan,1)=Kanone(kan,1)-2
Next
EndIf
If Kanone(kan,1)=20 Then
Delay 5000
EndIf
Amd Athlon 2200+,Saphire Atlantis Radeon9800pro,1024 MB DDR RAm,40 Gb Festblatte.
'in shâ'a llâh=so Gott will
Fertiges Projekt:Invasion der Heuschrecken
 

newkev

BeitragSo, Jan 04, 2004 13:57
Antworten mit Zitat
Benutzer-Profile anzeigen
versuch das mal:
Code: [AUSKLAPPEN]

If Kanone(kan,1)>20 Then
Delay 5000
EndIf
Signatur? Gibts nich^^
 

sven123

BeitragSo, Jan 04, 2004 13:59
Antworten mit Zitat
Benutzer-Profile anzeigen
Hmm so geht es leider auch nicht!Da stockt das Game dann schon von anfang an,wenn man die Rakete Startet.
Amd Athlon 2200+,Saphire Atlantis Radeon9800pro,1024 MB DDR RAm,40 Gb Festblatte.
'in shâ'a llâh=so Gott will
Fertiges Projekt:Invasion der Heuschrecken

Rallimen

Sieger des 30-EUR-Wettbewerbs

BeitragSo, Jan 04, 2004 14:34
Antworten mit Zitat
Benutzer-Profile anzeigen
Hi, hier die Funktionen inklusive DemoCode: [AUSKLAPPEN]
Graphics 800,600,16,2 ;
SetBuffer BackBuffer()
Const ESC = 1, Bildwiederholung = 50
Const Hoch= 200,Runter=208,Links = 203,Rechts=205
Const Links_Alt= 56,Space = 57
frameTimer=CreateTimer(Bildwiederholung)
Dim Schuss(30,3); in 0 aktiv, in 1 x, in 2 y,  in 3 art, kann nach belieben erweitert werden
;Hauptschleife
While Not KeyDown(ESC)
   If KeyDown(Hoch)      Then    Y=Y -2
   If KeyDown(Runter)   Then   Y=Y +2
   If KeyDown(Links)      Then   x= x -2
   If KeyDown(Rechts)   Then   x= x +2
        Rect x,y,20,50,1 ; Super raumschiff Malen

   ; schussabgabe >>>>>>>    schuss_starten(X,Y,Art )
   If KeyHit(Space) Then  schuss_starten(   x+10,   y-25,   0 )
   If KeyHit(Links_Alt) Then  schuss_starten(   x+10,   y-25,   1 )
   Schuss_malen() ; alle malen die aktiv sind

   WaitTimer(frameTimer)
   Flip
   Cls
Wend
End

Function  schuss_starten  (x_pos,y_pos,Art= 0)
 For t= 0 To 30
  If Schuss(t,0)= 0 Then ; freien Schuss gefunden ;bzw Leere variable
    Schuss(t,0) = 1  ; schuss aktivieren
    Schuss(t,1) = x_pos ; positionen übergeben
    Schuss(t,2) =y_pos
   Schuss(t,3) = Art ;welche Waffe es ist
    Exit ;schleife verlassen da eine gefunden wurde
 End If
Next
End Function

Function    Schuss_malen() ; alle malen
For t= 0 To 30
  If Schuss(t,0) = 1 Then ; Wenn aktiver Schuss dann malen
   Select Schuss(t,3) ; je nach art der waffe
     Case 0  ; hier evt. standard laser
       Schuss(t,2) =Schuss(t,2) - 5 ;Schuss weiter nach oben
      If  Schuss(t,2) <    - 50 Then  ; -50 <<Je nach Größe des bildes
          Schuss(t,0) = 0 ;Abschalten
      End If
      Rect Schuss(t,1),    Schuss(t,2) ,1,30,1
       ;DrawImage    Laserbild,     Schuss(t,1),    Schuss(t,2)
     Case 1  ; Vieleicht rakete usw.
           Schuss(t,2) =Schuss(t,2) - 3 ;Schuss weiter nach oben
      If  Schuss(t,2) <    - 50 Then  ;Je nach Größe des bildes
          Schuss(t,0) = 0 ;Abschalten
      End If
      Rect Schuss(t,1),    Schuss(t,2) ,3,8,1
       ;DrawImage    Laserbild,     Schuss(t,1),    Schuss(t,2)
     Case 3
     ; Vieleicht ne Mine usw.
     End Select
  End If
Next
End Function

sieht viel aus, aber isses nur wegen den ganzen Komentaren
1. Function werden Daten nmit übergeben von wo geschossen wird und erstellt einen schuss
2. Function werden die Laser und Bomben veschoben und gemalt
schau dir das mal im editor an dann erkennst du das auch besser

Noch was vergessen:
mit Space laser abschiessen
mit Linker Alt taste ne Rakete
Steuerung mir Pfeiltasten
[BB2D | BB3D | BB+]
 

sven123

BeitragSo, Jan 04, 2004 15:30
Antworten mit Zitat
Benutzer-Profile anzeigen
Cool Rallimen dieses Beispiel hat mir sehr gehofen allerdings habe ich jetzt ein kleines anderes Problem.

Code: [AUSKLAPPEN]
;Schusstest
If KeyDown(157)  Then
Kanone(kan,0)=x
Kanone(kan,1)=y
Kanone(kan,2)=1
EndIf
;Extras
;Kanone am Padel
If Kanone(kan,2)=1 Then
For kan=0 To 0
DrawImage Kanonenkugel,Kanone(kan,0),Kanone(kan,1)
Kanone(kan,1)=Kanone(kan,1)-2
Next
EndIf
For kan=0 To 0
If Kanone(kan,1)>20  Then
Delay 5000
EndIf
Next

Wie du siehst habe ich das Problem gelöst allerdings gibt es jetzt ein neues kleines Problem.Wenn die Rakete die Position 20 unterschreitet dann soll das gesammte spiel um 5 sek angehalten werden.
Könnt ihr mir sagen was ich falsch mach ich komme einfach nicht darauf.

thx euer Sven
Amd Athlon 2200+,Saphire Atlantis Radeon9800pro,1024 MB DDR RAm,40 Gb Festblatte.
'in shâ'a llâh=so Gott will
Fertiges Projekt:Invasion der Heuschrecken

Julz

BeitragSo, Jan 04, 2004 15:47
Antworten mit Zitat
Benutzer-Profile anzeigen
Also erst ma würde ich if keydown(57) und nich if keydown(157) schreiben
und dann noch ne frage was soll die schleife bringen
for kan=0 to 0
das kann man sich jawohl schenken oder hast du dich da verschrieben ich vermute schon da soll 10 oder so hin oder ???
Ich würd das so machen:
Code: [AUSKLAPPEN]

;Schusstest
If KeyDown(157)  Then
kan = kan + 1
Kanone(kan,0)=x
Kanone(kan,1)=y
Kanone(kan,2)=1
EndIf
;Extras
;Kanone am Padel
If Kanone(kan,2)=1 Then
For kan=0 To 10
DrawImage Kanonenkugel,Kanone(kan,0),Kanone(kan,1)
Kanone(kan,1)=Kanone(kan,1)-2
Next
EndIf
For kan=0 To 10
If Kanone(kan,1)>20  Then
Delay 5000
EndIf
Next
 

sven123

BeitragSo, Jan 04, 2004 16:05
Antworten mit Zitat
Benutzer-Profile anzeigen
Jo!Da hab ich mich vertippt sorry!!! :oops:Trotzdem funtzt die Kollision net.
Amd Athlon 2200+,Saphire Atlantis Radeon9800pro,1024 MB DDR RAm,40 Gb Festblatte.
'in shâ'a llâh=so Gott will
Fertiges Projekt:Invasion der Heuschrecken

Julz

BeitragSo, Jan 04, 2004 16:36
Antworten mit Zitat
Benutzer-Profile anzeigen
Wäre ganz cool wenn du en bisschen mehr code zeigen würdest damit man besser versteht wo der fehler oder das problem genau liegt
 

sven123

BeitragSo, Jan 04, 2004 16:39
Antworten mit Zitat
Benutzer-Profile anzeigen
Ok hier mal den restlichen Code: Laughing

Code: [AUSKLAPPEN]
;588,469 Gröse des Hintergrund bildes
.marke1
.marke
Graphics 640,480,16,1
SetBuffer BackBuffer()
umrandung=LoadImage("c:\Programme\Blitz2DDemo\help\resources\samples\graphics\block3.bmp")
spieler=LoadImage("d:\Eigene Bilder\spieler3.bmp")
spieler1=LoadImage("d:\Eigene Bilder\spieler1.bmp")
spieler2=LoadImage("d:\Eigene Bilder\spieler2.bmp") 
box=LoadImage("c:\Programme\Blitz2DDemo\help\resources\samples\graphics\blocks1.bmp")
ball=LoadImage("d:\Eigene Bilder\balld.bmp")
lava=LoadImage("d:\Eigene Bilder\lava.bmp")
lifecoins=LoadImage("d:\Eigene Bilder\life coins.bmp")
font=LoadFont("d:\Eigene Bilder\roman.fon",20,1,0,0)
font1=LoadFont("d\Eigene Bilder\anythingyouwant.ttf",100,1,0,0)
black=LoadImage("d:\Eigene Bilder\call1.bmp")
Titel=LoadImage("d:\Eigene Bilder\sadam1a.bmp")
hinternisse1=LoadImage("c:\Programme\Blitz2DDemo\help\resources\samples\graphics\verticalbullet1.bmp")
Pbloecke=LoadImage("d:\Eigene Bilder\blocke2.bmp")
Pbloecke1=LoadImage("d:\Eigene Bilder\blocke3.bmp")
Pbloecke2=LoadImage("d:\Eigene Bilder\blocke1.bmp")
Pbloecke3=LoadImage("d:\Eigene Bilder\blocke4.bmp")
Siegbild=LoadImage("d:\Eigene Bilder\Döner1.jpg")
Verbleibendezeit=LoadImage("d:\\Eigene Bilder\Uhren.jpg")
Siegbild2=LoadImage("d:\Eigene Bilder\Gewinner.jpg")
Gewinnsound=LoadSound("d:\Eigene Bilder\applaus.wav")
Losersound=LoadSound("d:\Eigene Bilder\Loser3.wav")
Plop=LoadSound("d:\Eigene Bilder\Plop.wav")
ExtraText=LoadImage("d:\Eigene Bilder\More Blocks Text.bmp")
ExtraText1=LoadImage("d:\Eigene Bilder\MirrorMode Text.bmp")
ExtraText2=LoadImage("d:\Eigene Bilder\Mehr Lifes Text.bmp")
ExtraText3=LoadImage("d:\Eigene Bilder\Padel Text.bmp")
Kanonenkugel=LoadImage("d:\Eigene Bilder\Kanone.bmp")
Global gewinn1=1
Global gewinn2=1
Global gewinn3=1
Global gewinn4=1
Global lifes=3
Global mehrlifes=1
Global tastensperre=1
Global tast=1
Global soundstop=1
Global soundstop1=1
Global soundstop2=1
Global Zeit=0
Global soundstop3=1
Global soundstop4=1
Global soundstop5=1
Global soundstop6=1
Global soundstop7=1
Global soundstop8=1
Global soundstop9=1
Global soundstop10=1
Global BoeckeWiderHerstellen=1
Global Extratextstop=1
Global Extratextstop1=1
Global MirrorMode=0
Global NormalSteuerung=1
Global MiMode=1
Global stopextra=1
Global GetrenntePadel=0
Global stopextra1=1
Global Extratextstop2=1
Global Extratextstop3=1
starttext=1
starttextbc=0
temp1=0
temp3=0
temp4=0
temp5=0
temp6=0
temp7=0
temp8=0
temp9=0
;timer
framerate=CreateTimer(80)
; variabele der hinternisse
h3=130
;
Dim hinternis(13,1)
Dim hinternis1(13,1)
Dim hinternis2(13,1)
Dim hinternis3(13,1)
Dim hinternis10(13,1)
Dim hinternis12(13,1)
Dim hinternis21(13,1)
Dim hinternis31(13,1)
Dim bloecke(44,2)
Dim bloecke1(45,2)
Dim bloecke2(45,2)
Dim bloecke3(37,2)
Dim Kanone(30,2)
Include "Bloecke.bb"
;
x3=330
y3=400
x4=275
y4=396
;Erster Teil der Spielfigur
Global x=300
Global y=400
;Ball
x1=290
y1=265
Global startb=1
Color 250,40,150
SetFont font
TileBlock Titel
Text 300,250,"Fuzzy Intelligence Game production!!!",1,0
Flip
track=Input("Bitte geben sie den Titel der Hintergrundmusik an[")
schwirigkeitsgrad=Input$("Geben sie den Schwirigkeitsgrad des Spiels an,Leicht=1,Mittel=2,Schwer=3![")
If schwirigkeitsgrad=0 Then schwirigkeitsgrad=Input$("Sie habem vergessen den Schwierigkeitsgrad anzugeben[")
Bild=Input("Bitte geben sie die Nummer ihres Hintergrundbildes an![")
Select schwirigkeitsgrad
Case 1
Zeit=1000
Case 2
Zeit=500
Case 3
Zeit=250
End Select
temp_time3=1*3
time4=MilliSecs()
;
temp_time=1*Zeit
time=MilliSecs()
;
temp_time1=1*25
time2=MilliSecs()
;
temp_time2=1*3
time3=MilliSecs()
;
temp_time4=1*27
time5=MilliSecs()
;
temp_time5=1*25
time6=MilliSecs()
;
temp_time6=1*3
time7=MilliSecs()
;
temp_time7=1*3
time8=MilliSecs()
;Level Laden
PlayCDTrack(track,2)
Select Bild
Case 0
Backgroundimage=LoadImage("d:\Eigene Bilder\Hintergrund.jpg")
Case 1
Backgroundimage=LoadImage("d:\Eigene Bilder\Hintergrund1.jpg")
Case 2
Backgroundimage=LoadImage("d:\Eigene Bilder\Hintergrund2.jpg")
Case 3
Backgroundimage=LoadImage("d:\Eigene Bilder\Hintergrund3.jpg")
Case 4
Backgroundimage=LoadImage("d:\Eigene Bilder\Hintergrund4.jpg")
Case 5
Backgroundimage=LoadImage("d:\Eigene Bilder\Hintergrund5.jpg")
End Select
FreeImage Titel
Dim level$(22,35)
leveldatei$=ReadFile("c:\Ingrid-Tile.txt")
For zeile=0 To 22
a$=ReadLine(leveldatei)
For spalte=0 To 35
level$(zeile,spalte)=Mid$(a$,spalte+1,1)
Next
Next
CloseFile leveldatei
If track=0  Then PlayMusic("d:\Eigene Bilder\walkoffame.mp3")
Repeat
Cls 
;Level Zeichnen
For zeile=0 To 22
For spalte=0 To 35
Select level$(zeile,spalte)
Case "1"
boxx=zeile
boxy=spalte
DrawImageRect box,spalte*32,zeile*32,70,274,32,32
Case "2"
DrawImage  Backgroundimage,spalte*32,zeile*32
Case "3"
DrawImage lava,spalte*32,zeile*32
End Select
Next
Next
If lifes=1 Then
DrawImage lifecoins,0,0
EndIf
If lifes=2 Then
DrawImage lifecoins,0,0
DrawImage lifecoins,30,0
EndIf
If lifes=3 Then
DrawImage lifecoins,0,0
DrawImage lifecoins,30,0
DrawImage lifecoins,60,0
EndIf
If lifes=4 Then
DrawImage lifecoins,0,0
DrawImage lifecoins,30,0
DrawImage lifecoins,60,0
DrawImage lifecoins,90,0
EndIf   
If temp1=1 Then
If MilliSecs()-time>1000
temp_time=temp_time-1
time=MilliSecs()
EndIf   
EndIf
;
If temp3=1 Then
If MilliSecs()-time2>1000
temp_time1=temp_time1-1
time2=MilliSecs()
EndIf
EndIf

If temp4=1 Then
If MilliSecs()-time3>1000
temp_time2=temp_time2-1
time3=MilliSecs()
EndIf
EndIf
;
If temp5=1 Then
If MilliSecs()-time4>1000
temp_time3=temp_time3-1
time4=MilliSecs()
EndIf
EndIf
;
If temp6=1 Then
If MilliSecs()-time5>1000
temp_time4=temp_time4-1
time5=MilliSecs()
EndIf
EndIf
;
If temp7=1 Then
If MilliSecs()-time6>1000
temp_time5=temp_time5-1
time6=MilliSecs()
EndIf
EndIf
;
If temp8=1 Then
If MilliSecs()-time7>1000
temp_time6=temp_time6-1
time7=MilliSecs()
EndIf
EndIf
;
If temp9=1 Then
If MilliSecs()-time8>1000
temp_time7=temp_time7-1
time8=MilliSecs()
EndIf
EndIf

Color 0,240,90
Text 550,0,": "+Str(temp_time)+" sek"
DrawImage Verbleibendezeit,520,0 
DrawImage spieler2,x4,y4
DrawImage spieler1,x3,y3
DrawImage spieler,x,y
;Blöcke erstellen
For k2=0 To 45
If ImagesCollide(ball,x1,y1,0,Pbloecke1,bloecke1(k2,0),bloecke1(k2,1),0) Then  bloecke1(k2,2)=0
Next
For k1=0 To 44
If ImagesCollide(ball,x1,y1,0,Pbloecke,bloecke(k1,0),bloecke(k1,1),0) Then  bloecke(k1,2)=0
Next
For k3=0 To 45
If ImagesCollide(ball,x1,y1,0,Pbloecke2,bloecke2(k3,0),bloecke2(k3,1),0) Then  bloecke2(k3,2)=0
Next
For k4=0 To 37
If ImagesCollide(ball,x1,y1,0,Pbloecke3,bloecke3(k4,0),bloecke3(k4,1),0) Then  bloecke3(k4,2)=0
Next
If bloecke3(0,2)=0 And bloecke3(1,2)=0 And bloecke3(2,2)=0 And bloecke3(3,2)=0 And bloecke3(4,2)=0 And bloecke3(5,2)=0 And bloecke3(6,2)=0 And bloecke3(7,2)=0 And bloecke3(8,2)=0 And bloecke3(9,2)=0 And bloecke3(10,2)=0 And bloecke3(11,2)=0 And bloecke3(12,2)=0 And bloecke3(13,2)=0 And bloecke3(14,2)=0 And bloecke3(15,2)=0 And bloecke3(16,2)=0 And bloecke3(17,2)=0 And bloecke3(18,2)=0 And bloecke3(19,2)=0 And bloecke3(20,2)=0 And bloecke3(21,2)=0 And bloecke3(22,2)=0 And bloecke3(23,2)=0 And bloecke3(24,2)=0  And bloecke3(25,2)=0 And bloecke3(26,2)=0 And bloecke3(27,2)=0 And bloecke3(28,2)=0 And bloecke3(29,2)=0 And bloecke3(30,2)=0 And bloecke3(31,2)=0 And bloecke3(32,2)=0 And bloecke3(33,2)=0 And bloecke3(34,2)=0 And bloecke3(35,2)=0 And bloecke3(36,2)=0 And bloecke3(37,2)=0 Then
gewinn3=0
EndIf
If bloecke2(0,2)=0 And bloecke2(1,2)=0 And bloecke2(2,2)=0 And bloecke2(3,2)=0 And bloecke2(4,2)=0 And bloecke2(5,2)=0 And bloecke2(6,2)=0 And bloecke2(7,2)=0 And bloecke2(8,2)=0 And bloecke2(9,2)=0 And bloecke2(10,2)=0 And bloecke2(11,2)=0 And bloecke2(12,2)=0 And bloecke2(13,2)=0 And bloecke2(14,2)=0 And bloecke2(15,2)=0 And bloecke2(16,2)=0 And bloecke2(17,2)=0 And bloecke2(18,2)=0 And bloecke2(19,2)=0 And bloecke2(20,2)=0 And bloecke2(21,2)=0 And bloecke2(22,2)=0 And bloecke2(23,2)=0 And bloecke2(24,2)=0  And bloecke2(25,2)=0 And bloecke2(26,2)=0 And bloecke2(27,2)=0 And bloecke2(28,2)=0 And bloecke2(29,2)=0 And bloecke2(30,2)=0 And bloecke2(31,2)=0 And bloecke2(32,2)=0 And bloecke2(33,2)=0 And bloecke2(34,2)=0 And bloecke2(35,2)=0 And bloecke2(36,2)=0 And bloecke2(37,2)=0 And bloecke2(38,2)=0 And bloecke2(39,2)=0 And bloecke2(40,2)=0 And bloecke2(41,2)=0 And bloecke2(42,2)=0 And bloecke2(43,2)=0 And bloecke2(44,2)=0 And bloecke2(45,2)=0 Then
gewinn2=0
EndIf
If  bloecke(1,2)=0 And bloecke(2,2)=0 And bloecke(3,2)=0  And bloecke(5,2)=0 And bloecke(6,2)=0 And bloecke(7,2)=0 And bloecke(8,2)=0 And bloecke(9,2)=0 And bloecke(10,2)=0 And bloecke(11,2)=0 And bloecke(12,2)=0 And bloecke(13,2)=0 And bloecke(14,2)=0 And bloecke(15,2)=0 And bloecke(16,2)=0 And bloecke(17,2)=0 And bloecke2(18,2)=0 And bloecke(19,2)=0  And bloecke(21,2)=0 And bloecke(22,2)=0 And bloecke(23,2)=0 And bloecke(24,2)=0  And bloecke(25,2)=0 And bloecke(26,2)=0 And bloecke(27,2)=0 And bloecke(28,2)=0 And bloecke(29,2)=0 And bloecke(30,2)=0 And bloecke(31,2)=0 And bloecke(32,2)=0 And bloecke(33,2)=0 And bloecke(34,2)=0 And bloecke(35,2)=0 And bloecke(36,2)=0 And bloecke(37,2)=0 And bloecke(38,2)=0 And bloecke(39,2)=0 And bloecke(40,2)=0 And bloecke(41,2)=0 And bloecke(42,2)=0 And bloecke(43,2)=0 And bloecke(44,2)=0  Then
gewinn4=0
EndIf
If bloecke1(0,2)=0 And bloecke1(1,2)=0 And bloecke1(2,2)=0 And bloecke1(3,2)=0 And bloecke1(4,2)=0 And bloecke1(5,2)=0 And bloecke1(6,2)=0 And bloecke1(7,2)=0 And bloecke1(8,2)=0 And bloecke1(9,2)=0 And bloecke1(10,2)=0 And bloecke1(11,2)=0 And bloecke1(12,2)=0 And bloecke1(13,2)=0 And bloecke1(14,2)=0 And bloecke1(15,2)=0 And bloecke1(16,2)=0 And bloecke1(17,2)=0 And bloecke1(18,2)=0 And bloecke1(19,2)=0 And bloecke1(20,2)=0 And bloecke1(21,2)=0 And bloecke1(22,2)=0 And bloecke1(23,2)=0 And bloecke1(24,2)=0  And bloecke1(25,2)=0 And bloecke1(26,2)=0 And bloecke1(27,2)=0 And bloecke1(28,2)=0 And bloecke1(29,2)=0 And bloecke1(30,2)=0 And bloecke1(31,2)=0 And bloecke1(32,2)=0 And bloecke1(33,2)=0 And bloecke1(34,2)=0 And bloecke1(35,2)=0 And bloecke1(36,2)=0 And bloecke1(37,2)=0 And bloecke1(38,2)=0 And bloecke1(39,2)=0 And bloecke1(40,2)=0 And bloecke1(41,2)=0 And bloecke1(42,2)=0 And bloecke1(43,2)=0 And bloecke1(44,2)=0 And bloecke1(45,2)=0 Then
gewinn1=0
EndIf     
For k1=0 To 44
If bloecke(k1,2)=1 Then
DrawImage  Pbloecke,bloecke(k1,0),bloecke(k1,1)
EndIf
Next
For k2=0 To 45
If bloecke1(k2,2)=1 Then
DrawImage Pbloecke1,bloecke1(k2,0),bloecke1(k2,1)
EndIf
Next
For k3=0 To 45
If bloecke2(k3,2)=1 Then
DrawImage Pbloecke2,bloecke2(k3,0),bloecke2(k3,1)
EndIf
Next
For k4=0 To 37
If bloecke3(k4,2)=1 Then
DrawImage Pbloecke3,bloecke3(k4,0),bloecke3(k4,1)
EndIf
Next
;Schusstest
If KeyDown(157) Then
Kanone(kan,0)=x
Kanone(kan,1)=y
Kanone(kan,2)=1
EndIf
;Extras
;Kanone am Padel
If Kanone(kan,2)=1 Then
For kan=0 To 10
DrawImage Kanonenkugel,Kanone(kan,0),Kanone(kan,1)
Kanone(kan,1)=Kanone(kan,1)-2
Next
EndIf     
;mehr Leben
If bloecke(4,2)=0 And mehrlifes=1  Then
lifes=lifes+1
mehrlifes=0 
EndIf
If Extratextstop3=1 And  bloecke(4,2)=0 Then
temp9=1
DrawImage ExtraText2,250,350
EndIf
If temp_time7=0 Then  Extratextstop3=0
;Getrennte Padels
If bloecke1(35,2)=0 And stopextra1=1  Then
temp7=1
If Extratextstop2=1 Then
temp8=1
DrawImage Extratext3,250,350
EndIf
NormalSteurung=0
GetrenntePadel=1
EndIf
If temp_time6=0 Then  Extratextstop2=0
If temp_time5=0 Then GetrenntePadel=0  NormalSteuerung=1 stopextra1=0 x3=330 y3=400 x4=275 y4=396 x=300 y=400
;MirrorMode
If bloecke(0,2)=0 And stopextra=1  Then
temp6=1
If Extratextstop1=1 Then
temp5=1 
DrawImage ExtraText1,250,350
EndIf
MirrorMode=1
NormalSteuerung=0
EndIf
If temp_time3=0 Then Extratextstop1=0
If temp_time4=0 Then NormalSteuerung=1 MirrorMode=0 stopextra=0
;Alle Blöcke wieder hergestelt
If bloecke2(20,2)=0 And BoeckeWiderHerstellen=1 Then
temp3=1
If Extratextstop=1 Then
temp4=1
DrawImage ExtraText,250,350
EndIf
;grün
bloecke(1,2)=1
bloecke(2,2)=1
bloecke(3,2)=1
bloecke(5,2)=1
bloecke(6,2)=1
bloecke(7,2)=1
bloecke(8,2)=1
bloecke(9,2)=1
bloecke(10,2)=1
bloecke(11,2)=1
bloecke(12,2)=1
bloecke(13,2)=1
bloecke(14,2)=1
bloecke(15,2)=1
bloecke(16,2)=1
bloecke(17,2)=1
bloecke(18,2)=1
bloecke(19,2)=1
bloecke(20,2)=1
bloecke(21,2)=1
bloecke(22,2)=1
bloecke(23,2)=1
bloecke(24,2)=1
bloecke(25,2)=1
bloecke(26,2)=1
bloecke(27,2)=1
bloecke(28,2)=1
bloecke(29,2)=1
bloecke(30,2)=1
bloecke(31,2)=1
bloecke(32,2)=1
bloecke(33,2)=1
bloecke(34,2)=1
bloecke(35,2)=1
bloecke(36,2)=1
bloecke(37,2)=1
bloecke(38,2)=1
bloecke(39,2)=1
bloecke(40,2)=1
bloecke(41,2)=1
bloecke(42,2)=1
bloecke(43,2)=1
bloecke(44,2)=1
;
;rosa
bloecke1(0,2)=1
bloecke1(1,2)=1
bloecke1(2,2)=1
bloecke1(3,2)=1
bloecke1(4,2)=1
bloecke1(5,2)=1
bloecke1(6,2)=1
bloecke1(7,2)=1
bloecke1(8,2)=1
bloecke1(9,2)=1
bloecke1(10,2)=1
bloecke1(11,2)=1
bloecke1(12,2)=1
bloecke1(13,2)=1
bloecke1(14,2)=1
bloecke1(15,2)=1
bloecke1(16,2)=1
bloecke1(17,2)=1
bloecke1(18,2)=1
bloecke1(19,2)=1
bloecke1(20,2)=1
bloecke1(21,2)=1
bloecke1(22,2)=1
bloecke1(23,2)=1
bloecke1(24,2)=1
bloecke1(25,2)=1
bloecke1(26,2)=1
bloecke1(27,2)=1
bloecke1(28,2)=1
bloecke1(29,2)=1
bloecke1(30,2)=1
bloecke1(31,2)=1
bloecke1(32,2)=1
bloecke1(33,2)=1
bloecke1(34,2)=1
bloecke1(35,2)=1
bloecke1(36,2)=1
bloecke1(37,2)=1
bloecke1(38,2)=1
bloecke1(39,2)=1
bloecke1(40,2)=1
bloecke1(41,2)=1
bloecke1(42,2)=1
bloecke1(43,2)=1
bloecke1(44,2)=1
bloecke1(45,2)=1
;
;blau
bloecke2(0,2)=1
bloecke2(1,2)=1
bloecke2(2,2)=1
bloecke2(3,2)=1
bloecke2(4,2)=1
bloecke2(5,2)=1
bloecke2(6,2)=1
bloecke2(7,2)=1
bloecke2(8,2)=1
bloecke2(9,2)=1
bloecke2(10,2)=1
bloecke2(11,2)=1
bloecke2(12,2)=1
bloecke2(13,2)=1
bloecke2(14,2)=1
bloecke2(15,2)=1
bloecke2(16,2)=1
bloecke2(17,2)=1
bloecke2(18,2)=1
bloecke2(19,2)=1
bloecke2(21,2)=1
bloecke2(22,2)=1
bloecke2(23,2)=1
bloecke2(24,2)=1
bloecke2(25,2)=1
bloecke2(26,2)=1
bloecke2(27,2)=1
bloecke2(28,2)=1
bloecke2(29,2)=1
bloecke2(30,2)=1
bloecke2(31,2)=1
bloecke2(32,2)=1
bloecke2(33,2)=1
bloecke2(34,2)=1
bloecke2(35,2)=1
bloecke2(36,2)=1
bloecke2(37,2)=1
bloecke2(38,2)=1
bloecke2(39,2)=1
bloecke2(40,2)=1
bloecke2(41,2)=1
bloecke2(42,2)=1
bloecke2(43,2)=1
bloecke2(44,2)=1
bloecke2(45,2)=1
;hellblau
bloecke3(0,2)=1
bloecke3(1,2)=1
bloecke3(2,2)=1
bloecke3(3,2)=1
bloecke3(4,2)=1
bloecke3(5,2)=1
bloecke3(6,2)=1
bloecke3(7,2)=1
bloecke3(8,2)=1
bloecke3(9,2)=1
bloecke3(10,2)=1
bloecke3(11,2)=1
bloecke3(12,2)=1
bloecke3(13,2)=1
bloecke3(14,2)=1
bloecke3(15,2)=1
bloecke3(16,2)=1
bloecke3(17,2)=1
bloecke3(18,2)=1
bloecke3(19,2)=1
bloecke3(20,2)=1
bloecke3(21,2)=1
bloecke3(22,2)=1
bloecke3(23,2)=1
bloecke3(24,2)=1
bloecke3(25,2)=1
bloecke3(26,2)=1
bloecke3(27,2)=1
bloecke3(28,2)=1
bloecke3(29,2)=1
bloecke3(30,2)=1
bloecke3(31,2)=1
bloecke3(32,2)=1
bloecke3(33,2)=1
bloecke3(34,2)=1
bloecke3(35,2)=1
bloecke3(36,2)=1
bloecke3(37,2)=1
EndIf
If temp_time1=0 Then BoeckeWiderHerstellen=0
If temp_time2=0 Then Extratextstop=0
;cheat
If KeyDown(32) Then  bloecke(38,2)=0
If KeyDown(50) Then  bloecke1(35,2)=0
If KeyDown(30) And KeyDown(48) Then
For k2=0 To 45
bloecke1(k2,2)=0
Next
For k1=0 To 44
bloecke(k1,2)=0
Next
For k3=0 To 45
bloecke2(k3,2)=0
Next
For k4=0 To 37
bloecke3(k4,2)=0
Next
EndIf
Include "Hinternisse.bb"
;
For i=0 To 13
If ImagesCollide(ball,x1,y1,0,hinternisse1,hinternis(i,0),hinternis(i,1),0) Then
If soundstop10=1 Then PlaySound (Plop)
startb=1
x10=0
y10=0
x6=0
x5=0
y6=0
y5=0
x7=0
y7=0
y8=0
x8=0
y9=0
x9=0
x17=0
y17=0
x16=0
y16=0
x15=0
y15=0
x14=0
y14=0
x11=0
y11=0
x12=0
y12=0
x13=0
y13=0
y10=y10+1
x10=x10+0.6
EndIf
Next
soundstop10=1
y1=y1+y10
x1=x1+x10

For j=0 To 13
If ImagesCollide(ball,x1,y1,0,hinternisse1,hinternis1(j,0),hinternis1(j,1),0) Then
If soundstop9=1 Then PlaySound (Plop)
z=0
startb=1
x11=0
y11=0
x6=0
x5=0
y6=0
y5=0
x7=0
y7=0
y9=0
x9=0
x7=0
y7=0
y8=0
x8=0
x17=0
y17=0
x16=0
y16=0
x15=0
y15=0
x14=0
y14=0
x10=0
y10=0
x12=0
y12=0
x13=0
y13=0
y11=y11+1
x11=x11+0.6
EndIf
Next
soundstop9=1
y1=y1+y11
x1=x1+x11
;
For b=0 To 13
If ImagesCollide(ball,x1,y1,0,hinternisse1,hinternis2(b,0),hinternis2(b,1),0) Then
If soundstop8=1 Then PlaySound (Plop)
z=0
startb=1
x12=0
y12=0
x6=0
x5=0
y6=0
y5=0
x7=0
y7=0
y8=0
x8=0
y9=0
x9=0
x17=0
y17=0
x16=0
y16=0
x15=0
y15=0
x14=0
y14=0
x11=0
y11=0
x10=0
y10=0
x13=0
y13=0
y12=y12+1
x12=x12+0.6
EndIf
Next
soundstop8=1
y1=y1+y12
x1=x1+x12
For c=0 To 13
If ImagesCollide(ball,x1,y1,0,hinternisse1,hinternis3(c,0),hinternis3(c,1),0) Then
If soundstop7=1 Then PlaySound (Plop)
z=0
startb=1
x13=0
y13=0
x6=0
x5=0
y6=0
y5=0
x7=0
y7=0
y8=0
x8=0
y9=0
x9=0
x17=0
y17=0
x16=0
y16=0
x15=0
y15=0
x14=0
y14=0
x11=0
y11=0
x10=0
y10=0
x12=0
y12=0
y13=y13+1
x13=x13+0.6
EndIf
Next
soundstop7=1
y1=y1+y13
x1=x1+x13
;zweite kollision
For i1=0 To 13
If ImagesCollide(ball,x1,y1,0,hinternisse1,hinternis10(i1,0),hinternis10(i1,1),0) Then
If soundstop6=1 Then PlaySound (Plop)
z=0
startb=1
x14=0
y14=0
x6=0
x5=0
y6=0
y5=0
x7=0
y7=0
y9=0
y8=0
x8=0
y10=0
x10=0
x11=0
y11=0
x12=0
y12=0
x13=0
y13=0
x17=0
y17=0
x16=0
y16=0
x15=0
y15=0
y14=y14+1
x14=x14-0.6
EndIf
Next
soundstop6=1
y1=y1+y14
x1=x1+x14
For j1=0 To 13
If ImagesCollide(ball,x1,y1,0,hinternisse1,hinternis12(j1,0),hinternis12(j1,1),0) Then
If  soundstop5 Then PlaySound (Plop)
soundstop5=0
z=0
startb=1
x15=0
y15=0
x6=0
x5=0
y6=0
y5=0
x7=0
y7=0
y9=0
x9=0
y8=0
x8=0
y10=0
x10=0
x11=0
y11=0
x12=0
y12=0
x13=0
y13=0
x17=0
y17=0
x16=0
y16=0
x14=0
y14=0
y15=y15+1
x15=x15-0.6
EndIf
Next
soundstop5=1
y1=y1+y15
x1=x1+x15
For b1=0 To 13
If ImagesCollide(ball,x1,y1,0,hinternisse1,hinternis21(b1,0),hinternis21(b1,1),0) Then
If soundstop4=1 Then PlaySound (Plop)
soundstop4=0
z=0
startb=1
x16=0
y16=0
x6=0
x5=0
y6=0
y5=0
x7=0
y7=0
y9=0
y8=0
x8=0
y10=0
x10=0
x11=0
y11=0
x12=0
y12=0
x13=0
y13=0
x17=0
y17=0
x15=0
y15=0
x14=0
y14=0
y16=y16+1
x16=x16-0.6
EndIf
Next
soundstop4=1
y1=y1+y16
x1=x1+x16
For c1=0 To 13
If ImagesCollide(ball,x1,y1,0,hinternisse1,hinternis31(c1,0),hinternis31(c1,1),0) Then
If soundstop3=1 Then PlaySound (Plop)
soundstop3=0
z=0
startb=1
x17=0
y17=0
x6=0
x5=0
y6=0
y5=0
y9=0
x7=0
y7=0
y8=0
x8=0
y10=0
x10=0
x11=0
y11=0
x12=0
y12=0
x13=0
y13=0
x16=0
y16=0
x15=0
y15=0
x14=0
y14=0
y17=y17+1
x17=x17-0.6
EndIf
Next
soundstop3=1
y1=y1+y17
x1=x1+x17
;
If NormalSteuerung=1 Then 
If KeyDown(205)And x3<(boxx*41.4)  Then ; Falls das Sprite nicht schon auf der äussersten Stelle ist...
x=x+2
x3=x3+2
x4=x4+2
EndIf
If KeyDown(203)And x4>(boxx*1.75) Then ; Falls das Sprite nicht schon auf der äussersten Stelle ist...
x=x-2
x3=x3-2
x4=x4-2
EndIf
EndIf
If MirrorMode=1 Then
If KeyDown(205)And x3>(boxx*5.75)  Then ; Falls das Sprite nicht schon auf der äussersten Stelle ist...
x=x-2
x3=x3-2
x4=x4-2
EndIf
If KeyDown(203)And x4<(boxx*37.5) Then ; Falls das Sprite nicht schon auf der äussersten Stelle ist...
x=x+2
x3=x3+2
x4=x4+2
EndIf
EndIf
If GetrenntePadel=1 Then
If KeyDown(205)And x3<(boxx*41.4)  Then ; Falls das Sprite nicht schon auf der äussersten Stelle ist...
x=x+1
x3=x3+6
x4=x4+6
EndIf
If KeyDown(203)And x4>(boxx*1.75) Then ; Falls das Sprite nicht schon auf der äussersten Stelle ist...
x=x-1
x3=x3-6
x4=x4-6
EndIf
EndIf
 
 
;Ball Laden
DrawImage ball,x1,y1
If starttext=1 Then
SetFont font
Color 255,255,255
Text 300,250,"Um das Spiel zu beginnen müssen sie die Leertaste drücken!",1,1
EndIf
If starttextbc=1 Then
SetFont font
Color 255,255,255
Text 300,250,"Um weiter zu spielen drücken sie die Leertaste!",1,1
temp1=0
EndIf
If KeyDown(57) And tastensperre=1 Then
tastensperre=0
startb=0
starttext=0
temp1=1
EndIf
If KeyDown (57) And tast=1  Then
tast=0
startb=0
starttextbc=0
temp1=1
EndIf 
If startb=0 Then
y1=y1+1
EndIf
;Kollision mit Ball
If ImagesCollide(spieler,x,y,0,ball,x1,y1,0) Then
startb=1
z=0
y9=0
x6=0
x5=0
y6=0
y5=0
x7=0
y7=0
y8=0
x8=0
y10=0
x10=0
x11=0
y11=0
x12=0
y12=0
x13=0
y13=0
x17=0
y17=0
x16=0
y16=0
x15=0
y15=0
x14=0
y14=0
z=z-1
EndIf
If ImagesCollide(spieler1,x3,y3,0,ball,x1,y1,0) Then
z=0
x5=0
y5=0
x6=0
y6=0
x7=0
y7=0
y8=0
x8=0
y9=0
y10=0
x10=0
x11=0
y11=0
x12=0
y12=0
x13=0
y13=0
x17=0
y17=0
x16=0
y16=0
x15=0
y15=0
x14=0
y14=0
startb=1
x5=x5-1
y5=y5-2
EndIf
If ImagesCollide(spieler2,x4,y4,0,ball,x1,y1,0) Then
z=0
x6=0
y6=0
x5=0
y5=0
x7=0
y7=0
y8=0
x8=0
y9=0
y10=0
x10=0
x11=0
y11=0
x12=0
y12=0
x13=0
y13=0
x17=0
y17=0
x16=0
y16=0
x15=0
y15=0
x14=0
y14=0
startb=1
x6=x6+1
y6=y6-2
EndIf
x1=x1+x6
y1=y1+y6
x1=x1+x5
y1=y1+y5
y1=y1+z
;Kollision von Ball mit Umrandung
SeedRnd MilliSecs()
If x1=20 Then
startb=1
z=0
x6=0
x5=0
y6=0
y5=0
y8=0
x8=0
y9=0
x17=0
y17=0
x16=0
y16=0
x15=0
y15=0
x14=0
y14=0
y10=0
x10=0
x11=0
y11=0
x12=0
y12=0
x13=0
y13=0
x7=0
y7=0
x7=x7+0.6
y7=y7+1
EndIf
x1=x1+x7
y1=y1+y7
If x1=585 Then
startb=1
z=0
x6=0
x5=0
y6=0
y5=0
x7=0
y7=0
y9=0
x17=0
y17=0
x16=0
y16=0
x15=0
y15=0
x14=0
y14=0
y10=0
x10=0
x11=0
y11=0
x12=0
y12=0
x13=0
y13=0
x8=0
y8=0
y8=y8+1
x8=x8-0.6
EndIf
y1=y1+y8
x1=x1+x8
If y1=20  Then
startb=1
z=0
x6=0
x5=0
y6=0
y5=0
x7=0
y7=0
y8=0
x8=0
x17=0
y17=0
x16=0
y16=0
x15=0
y15=0
x14=0
y14=0
y10=0
x10=0
x11=0
y11=0
x12=0
y12=0
x13=0
y13=0
y9=0
y9=y9+1
EndIf
y1=y1+y9
If y1=450 Then
startb=1
starttextbc=1
z=0
x6=0
x5=0
y6=0
y5=0
x7=0
y7=0
y8=0
x8=0
y9=0
x17=0
y17=0
x16=0
y16=0
x15=0
y15=0
x14=0
y14=0
y10=0
x10=0
x11=0
y11=0
x12=0
y12=0
x13=0
y13=0
tast=1
;Spielfigur zurücksetzen
x3=330
y3=400
x4=275
y4=396
x=300
y=400
;
lifes=lifes-1
x1=290
y1=265
If startb=0 Then
y1=y1+1
EndIf
EndIf
If KeyDown(31) Then
SaveBuffer FrontBuffer(),"c:\Tile.bmp"
EndIf
If lifes=-1 Then
Cls
SetFont font1
TileBlock  black
Color 100,0,0
If soundstop1=1 Then
PlaySound (Losersound)
EndIf
Text 300,250,"Game Over!!!",1,1
soundstop1=0
If KeyDown(28) Then
Goto marke
FreeFont font
FreeFont font1
FreeImage balck
FreeSound Losersound
FreeSound Gewinnsound
FreeImage Pbloecke
FreeImage Pbloecke1
FreeImage Pbloecke2
FreeImage Pbloecke3
FreeImage Siegbild
FreeImage Siegbild2
FreeImage Umrandung
FreeImage spieler
FreeImage spieler1
FreeImage spieler2
FreeImage box
FreeImage ball
FreeImage lava
FreeImage lifecoins
FreeImage Backgroundimage
FreeImage Titel
FreeImage hinternisse1
FreeSound Plop
FreeImage MehrLebenBlock
FreeImage ExtraText
FreeImage ExtraText1
FreeImage ExtraText2
FreeImage ExtraText3
EndIf
EndIf
If temp_time=0 Then
Cls 
SetFont font1
TileBlock  black
If soundstop2=1 Then
PlaySound (Losersound)
EndIf
Color 100,0,0
Text 300,250,"Game Over!!!",1,1
soundstop2=0
temp1=0
If KeyDown(28) Then
Goto marke1
FreeFont font
FreeFont font1
FreeImage balck
FreeSound Losersound
FreeSound Gewinnsound
FreeImage Pbloecke
FreeImage Pbloecke1
FreeImage Pbloecke2
FreeImage Pbloecke3
FreeImage Siegbild
FreeImage Siegbild2
FreeImage Umrandung
FreeImage spieler
FreeImage spieler1
FreeImage spieler2
FreeImage box
FreeImage ball
FreeImage lava
FreeImage lifecoins
FreeImage Backgroundimage
FreeImage Titel
FreeImage hinternisse1
FreeSound  Plop
FreeImage MehrLebenBlock
FreeImage ExtraText
FreeImage ExtraText1
FreeImage ExtraText2
FreeImage ExtraText3
EndIf
EndIf
If gewinn1=0 And gewinn2=0 And gewinn3=0 And gewinn4=0 Then
Cls
DrawImage  Siegbild,200,300
DrawImage  Siegbild2,250,0
If soundstop=1 Then
PlaySound (Gewinnsound)
EndIf
soundstop=0
EndIf   
Flip WaitTimer(framerate)
Amd Athlon 2200+,Saphire Atlantis Radeon9800pro,1024 MB DDR RAm,40 Gb Festblatte.
'in shâ'a llâh=so Gott will
Fertiges Projekt:Invasion der Heuschrecken

Julz

BeitragSo, Jan 04, 2004 16:43
Antworten mit Zitat
Benutzer-Profile anzeigen
Also das mit den bloecken und so hätte es da nicht auch ne schleife getan ???
Is ja ziemlich verwirrend dein code

Rallimen

Sieger des 30-EUR-Wettbewerbs

BeitragSo, Jan 04, 2004 16:45
Antworten mit Zitat
Benutzer-Profile anzeigen
hier lisgt schon mal der fehler, wenn es stehen bleiben soll wenn unter 20
dann muss das so sein
Code: [AUSKLAPPEN]
For kan=0 To 10
If Kanone(kan,1)>20  Then ; hier bleibt er stehen wenn uber 20, also immer
Delay 5000
EndIf
Next

das muss dann so seinCode: [AUSKLAPPEN]
For kan=0 To 10
If Kanone(kan,1)<20  Then ; wenn kleiner 20
Delay 5000
EndIf
Next
[BB2D | BB3D | BB+]
 

sven123

BeitragSo, Jan 04, 2004 17:18
Antworten mit Zitat
Benutzer-Profile anzeigen
Dann stoppts irgendwie schon im Hauptmenü!!!Trotzdem danke.
Amd Athlon 2200+,Saphire Atlantis Radeon9800pro,1024 MB DDR RAm,40 Gb Festblatte.
'in shâ'a llâh=so Gott will
Fertiges Projekt:Invasion der Heuschrecken

Jolinah

BeitragSo, Jan 04, 2004 17:18
Antworten mit Zitat
Benutzer-Profile anzeigen
Ich würde Types vorschlagen. Klar, bei sachen wie Tile Engine is nen Array viel besser. Aber gerade bei so Sachen wie Schüsse usw.. wo man nie weiss wie viele es davon gibt usw. eignen sich Types herrvorragend.

Code: [AUSKLAPPEN]

Type schuss
Field x,y  ;X und Y Position (aktuell)
Field dir   ;Flugrichtung
Field Art  ;Art des Schusses
End Type


Dann um nen neuen schuss zu machen:

Code: [AUSKLAPPEN]

s.schuss = new schuss
s\x = PlayerX
s\y = PlayerY
s\dir = -1 ;oder andere richtung
s\art = 0



Um das ganze zu zeichnen:

Code: [AUSKLAPPEN]

For s.schuss = each schuss
  Select s\art
    Case 0
      DrawImage schuss0,s\x,s\y
      if s\dir = -1 or s\dir = 1 then s\x = s\x + s\dir
      if s\dir = -2 then s\y = s\y - 1
      if s\dir = 2 then s\y = s\y + 1
  End Select
Next


Zum löschen: bzw. Wenn der schuss den Bildschirm verlässt etc.

Code: [AUSKLAPPEN]

For s.schuss = each schuss
  if s\x > Bildschirmrand or s\x < 0 or s\y > Bildschirmrand or s\y < 0
    delete s
  endif
Next


So einfach. Und damit man nicht mehrere Schleifen machen braucht kann man das auch in die Obere schleife packen. Weil man da ja eh schon jeden schuss abfragt zum zeichnen.


Somit wird für die Schussart 0 das Bild 0 an der Schussposition gezeichnet. Und die Position jedesmal um den Richtigen Wert erhöht, je nach Richtung.

Also ich persönlich find das viel einfacher als ein Array in diesem Fall. Da braucht man auch nichts zu redimensionieren falls es mal 40 schüsse auf dem bildschirm hat statt 30.

Flori-D

BeitragSo, Jan 04, 2004 18:09
Antworten mit Zitat
Benutzer-Profile anzeigen
Bau an der stelle wo Delay steht doch lieber einen Timer ein.Delay is finde ich nicht so gt.
BB is Macht!

Homepage: www.flori-d.de

Gehe zu Seite 1, 2  Weiter

Neue Antwort erstellen


Übersicht BlitzBasic Allgemein

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group