Kleines Problem mit direct Play

Übersicht BlitzBasic Allgemein

Gehe zu Seite 1, 2  Weiter

Neue Antwort erstellen

 

sven123

Betreff: Kleines Problem mit direct Play

BeitragFr, Feb 13, 2004 22:57
Antworten mit Zitat
Benutzer-Profile anzeigen
Der Host wir aufgebaut und man kann auch per Join dem Caht beitreten,doch werden die Mails die man sich dann schreiben kann nicht angezeigt.Warum?
Code: [AUSKLAPPEN]
;chat
If RecvNetMsg()=1
Code=NetMsgType()
Select Code
Case 100
Text 0,565, "Neuer chat Teilnehmer ist beigetreten",1,0
Case 101
Text 0,565, "Ein chat Teilnehmer hat den chat verlassen",1,0
Case 102
Text 0,565, "der Host des chats hat den chat verlassen",1,0 :StopNetGame()
Default
Text 0,565, NetPlayerName$(NetMsgFrom())+":"+NetMsgData$(),1,0
End Select
EndIf
If KeyDown(46)
Locate 0,580 
Msg$=Input(">>") 
Locate 0,580
SendNetMsg 1,Msg$,teilnehmer,alle
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

Jolinah

BeitragSa, Feb 14, 2004 1:47
Antworten mit Zitat
Benutzer-Profile anzeigen
Ist das ganze in ner Schleife?

Wenn nicht, solltest du es in eine Schleife packen.


Ist SendNetMsg in deinem Beispiel Pseudocode oder sind teilnehmer und alle variablen?

Um an Alle zu senden sollte es 0 sein.

PS: Ich würde es sowieso besser mit UDP Machen, ist eigentlich nicht schwer:

Server:
Code: [AUSKLAPPEN]

Type client
Field name$
Field ip
Field port
End Type

udp = CreateUDPStream(8000)  ;Port kann anders sein ;)

Repeat
  If RecvUdpMsg(udp) <> 0
    client_ip = UdpMsgIP(udp)
    client_port = UdpMsgPort(udp)

    code = ReadByte(udp)

    Select code
      Case 1
        name$ = ReadString$(udp)
        cl.client = new client
        cl\name$ = name$
        cl\ip = client_ip
        cl\port = client_port

        ;An allen sagen das jemand neues da ist ausser der Person selber
        For cl.client = each client
          If not cl\name$ = name$
            WriteByte udp,1
            WriteString udp, name$
            SendUdpMsg udp,cl\ip,cl\port
          Endif
        Next

        Print "Client " + name$ + " connected."

      Case 2
        name$ = ReadString$(udp)
        txt$ = ReadString$(udp)

        ;Chat text allen senden ausser sich selbst.
        For cl.client = each client
          If not cl\name$ = name$
            WriteByte udp, 2
            WriteString udp, name$
            WriteString udp, txt$
            SendUdpMsg udp,cl\ip,cl\port
          Endif
        Next

        Print name$ + ": " + txt$

      Default
    End Select
  Endif

Until Keyhit(1)

CloseUdpStream(udp)
Delete each client

End



client:
Code: [AUSKLAPPEN]

udp = CreateUDPStream()   ;Port wird automatisch gewählt

client_name$ = Input("Name: ")

;IP muss ein Int sein, Int_IP wandelt ein String, die Funktion ist unten
server_ip = Int_IP("xxx.xxx.xxx.xxx")
server_port = 8000

;Bei Server anmelden mit code 1
WriteByte udp, 1
WriteString udp, client_name$
SendUDPMsg udp, server_ip, server_port

;Meldungen empfangen
Repeat

  If RecvUdpMsg(udp) <> 0
    code = ReadByte(udp)

    Select code
      Case 1
        name$ = ReadString$(udp)

        ;Wenn du eine Liste der Clients machen willst müsste hier halt
        ;wieder was hin das die Client namen speichert, mit types oder
        ;arrays. Damit du Anzeigen lassen kannst wer alles verbunden ist.

        Print name$ + " ist dem Chat beigetreten."

      Case 2
        name$ = ReadString$(udp)
        txt$ = ReadString$(udp)

        Print name$ + ": " + txt$

      Default
    End Select
  Endif

  in$ = Input("Chat: ")
  WriteByte udp, 2
  WriteString udp, client_name$
  WriteString udp, in$
  SendUDPMsg udp, server_ip, server_port

Until Keyhit(1) or in$ = "exit"

CloseUdpStream(udp)

End

Function Int_IP(IP$)

  a1=val(Left(IP$,Instr(IP$,".")-1)) : IP$=Right(IP$,Len(IP$)-Instr(IP$,"."))
  a2=val(Left(IP$,Instr(IP$,".")-1)) : IP$=Right(IP$,Len(IP$)-Instr(IP$,"."))
  a3=val(Left(IP$,Instr(IP$,".")-1)) : IP$=Right(IP$,Len(IP$)-Instr(IP$,"."))
  a4=val(IP$)
  Return (a1 Shl 24) + (a2 Shl 16) + (a3 Shl 8 ) +a4

End Function

Function val(String$)
   ac=String$
   Return String$
End Function



Hoffe du kannst damit was anfangen Wink
Ist eigentlich ganz einfach. Das ist jedoch bisschen anders als bei Direct play gemacht. Hier ist nicht ein Client selber gleichzeitig der Server, sondern der Server ist ein unabhängiges Programm. Das heisst für 2 clients musst du 2 mal den client starten und 1 mal den server. Jedoch darauf achten das du in meinem Beispiel client_name$ bei jedem änderst da sonst der server nicht mehr richtig funktioniert wenn beide clients gleich heissen.

Anderer Nachteil ist beim Client Input: Das ganze programm wird angehalten, eingehende nachrichten werden erst überprüft nachdem du was geschrieben hast, besser wäre es mit ner eigenen Input routine die das Programm nicht unterbricht.

Ist nicht optimal halt, sollte nur den Aufbau zeigen, man kann es eigentlich genau wie bei Direct Play machen, man sendet immer ein Byte das die ID der Message ist. Und bevor man sonst irgendwas liest, liest man auch zuerst wieder dieses Byte. so kann man von 0 bis 255 alle Meldungen selber definieren.

Shadow of the night

BeitragSa, Feb 14, 2004 10:54
Antworten mit Zitat
Benutzer-Profile anzeigen
Jolinah ich weiss ja nicht wieso, aber bei mir will der Server nicht so recht laufen, ich schau mal nach dem Fehler wenn ich Zeit habe.

MfG Shadow of the Night
User posted image
 

sven123

BeitragSa, Feb 14, 2004 11:19
Antworten mit Zitat
Benutzer-Profile anzeigen
Sorry ich muss euch jetzt mit einem riesen Quell Code quälen.Denn ich sehe mich auserstande dieses Problem selber zu lösen.Warum kommen die gesendeten Nachrichten nicht an?
Code: [AUSKLAPPEN]
;588,469 Gröse des Hintergrund bildes
.marke1
.marke
Graphics 640,480,16,1
SetBuffer BackBuffer()
umrandung=LoadImage("Gfx\block3.bmp")
spieler=LoadImage("Gfx\spieler3.bmp")
spieler1=LoadImage("Gfx\spieler1.bmp")
spieler2=LoadImage("Gfx\spieler2.bmp") 
box=LoadImage("Gfx\linde.jpg")
ball=LoadImage("Gfx\balld.bmp")
lava=LoadImage("Gfx\lava.bmp")
lifecoins=LoadImage("Gfx\life coins.bmp")
font=LoadFont("Fonts\roman.fon",20,1,0,0)
font1=LoadFont("Fonts\anythingyouwant.ttf",100,1,0,0)
hinternisse1=LoadImage("Gfx\verticalbullet1.bmp")
Pbloecke=LoadImage("Gfx\blocke2.bmp")
Pbloecke1=LoadImage("Gfx\blocke3.bmp")
Pbloecke2=LoadImage("Gfx\blocke1.bmp")
Pbloecke3=LoadImage("Gfx\blocke4.bmp")
Siegbild=LoadImage("Gfx\Döner1.jpg")
Siegbild2=LoadImage("Gfx\Gewinner.jpg")
Gewinnsound=LoadSound("Sounds/applaus.wav")
Losersound=LoadSound("Sounds\Loser3.wav")
Plop=LoadSound("Sounds\Plop.wav")
ExtraText=LoadImage("Gfx\More Blocks Text.bmp")
ExtraText1=LoadImage("Gfx\MirrorMode Text.bmp")
ExtraText2=LoadImage("Gfx\Mehr Lifes Text.bmp")
ExtraText3=LoadImage("Gfx\Padel Text.bmp")
HauptmenueSchalter1=LoadImage("Gfx\HautmenüSchalter1.bmp")
HauptmenueSchalter2=LoadImage("Gfx\Hautmenü Schalter 2.bmp")
Maus=LoadImage("Gfx\camel.bmp")
HauptmenueSchalter3=LoadImage("Gfx\Schwierig.bmp")
HauptmenueSchalter4=LoadImage("Gfx\Mittel.bmp")
HauptmenueSchalter5=LoadImage("Gfx\Leicht.bmp")
Punkt=LoadImage("Gfx\Punkt3.bmp")
Ende=LoadImage("Gfx\Ende.bmp")
Grafik=LoadImage("Gfx\Grafik1.bmp")
Bild1=LoadImage("Gfx\bild1.bmp")
Bild2=LoadImage("Gfx\bild2.bmp")
Bild3=LoadImage("Gfx\bild3.bmp")
Bild4=LoadImage("Gfx\bild4.bmp")
Bild5=LoadImage("Gfx\bild5.bmp")
Bild0=LoadImage("Gfx\bild0.bmp")
zurück=LoadImage("Gfx\zurück.bmp")
Sound=LoadImage("Gfx\Sounds.bmp")
Titel1=LoadImage("Gfx\Titel1.bmp")
Titel2=LoadImage("Gfx\Titel2.bmp")
Titel3=LoadImage("Gfx\Titel3.bmp")
Titel4=LoadImage("Gfx\Titel4.bmp")
Titel0=LoadImage("Gfx\Titel0.bmp")
Titel5=LoadImage("Gfx\Titel5.bmp")
Titel6=LoadImage("Gfx\Titel6.bmp")
Titel7=LoadImage("Gfx\Titel7.bmp")
Titel8=LoadImage("Gfx\Titel8.bmp")
Titel9=LoadImage("Gfx\Titel9.bmp")
Titel10=LoadImage("Gfx\Titel10.bmp")
Titel11=LoadImage("Gfx\Titel11.bmp")
Titel12=LoadImage("Gfx\Titel12.bmp")
Titel13=LoadImage("Gfx\Titel13.bmp")
Titel14=LoadImage("Gfx\Titel14.bmp")
Titel15=LoadImage("Gfx\Titel15.bmp")
Titel16=LoadImage("Gfx\Titel16.bmp")
Titel17=LoadImage("Gfx\Titel17.bmp")
wecker=LoadImage("Gfx\wecker.jpg")
Chatoptionen=LoadImage("Gfx\chatoptionen.bmp")
Host=LoadImage("Gfx\Host.bmp")
Join=LoadImage("Gfx\Join.bmp")
Global Extratextnicht=1
Global stopextra6=1
Global gewinn1=1
Global gewinn2=1
Global gewinn3=1
Global gewinn4=1
Global lifes=3
Global mehrlifes=1
Global mehrlifes1=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
Global Extratextstop5=1
Global frame=80
Global Spezial=1
Global Punkte=0
Global punktok=1
Global punktok1=1
Global punktok2=1
Global punktok3=1
Global punktok4=1
Global punktok5=1
Global punktok6=1
Global punktok7=1
Global punktok8=1
Global punktok9=1
Global punktok10=1
Global punktok11=1
Global punktok12=1
Global punktok13=1
Global punktok14=1
Global punktok15=1
Global punktok16=1
Global punktok17=1
Global punktok18=1
Global punktok19=1
Global punktok20=1
Global punktok21=1
Global punktok22=1
Global punktok23=1
Global punktok24=1
Global punktok25=1
Global punktok26=1
Global punktok27=1
Global punktok28=1
Global punktok29=1
Global punktok30=1
Global punktok31=1
Global punktok32=1
Global punktok33=1
Global punktok34=1
Global punktok35=1
Global punktok36=1
Global punktok37=1
Global punktok38=1
Global punktok39=1
Global punktok40=1
Global punktok41=1
Global punktok42=1
Global punktok43=1
Global punktok44=1
Global punktok45=1
Global punktok46=1
Global punktok47=1
Global punktok48=1
Global punktok49=1
Global punktok50=1
Global punktok51=1
Global punktok52=1
Global punktok53=1
Global punktok54=1
Global punktok55=1
Global punktok56=1
Global punktok57=1
Global punktok58=1
Global punktok59=1
Global punktok60=1
Global punktok61=1
Global punktok62=1
Global punktok63=1
Global punktok64=1
Global punktok65=1
Global punktok66=1
Global punktok67=1
Global punktok68=1
Global punktok69=1
Global punktok70=1
Global punktok71=1
Global punktok72=1
Global punktok73=1
Global punktok74=1
Global punktok75=1
Global punktok76=1
Global punktok77=1
Global punktok78=1
Global punktok79=1
Global punktok80=1
Global punktok81=1
Global punktok82=1
Global punktok83=1
Global punktok84=1
Global punktok85=1
Global punktok86=1
Global punktok87=1
Global punktok88=1
Global punktok89=1
Global punktok90=1
Global punktok91=1
Global punktok92=1
Global punktok93=1
Global punktok94=1
Global punktok95=1
Global punktok96=1
Global punktok97=1
Global punktok98=1
Global punktok99=1
Global punktok100=1
Global punktok101=1
Global punktok102=1
Global punktok103=1
Global punktok104=1
Global punktok105=1
Global punktok106=1
Global punktok107=1
Global punktok108=1
Global punktok109=1
Global punktok110=1
Global punktok111=1
Global punktok112=1
Global punktok113=1
Global punktok114=1
Global punktok115=1
Global punktok116=1
Global punktok117=1
Global punktok118=1
Global punktok119=1
Global punktok120=1
Global punktok121=1
Global punktok122=1
Global punktok123=1
Global punktok124=1
Global punktok125=1
Global punktok126=1
Global punktok127=1
Global punktok128=1
Global punktok129=1
Global punktok130=1
Global punktok131=1
Global punktok132=1
Global punktok133=1
Global punktok134=1
Global punktok135=1
Global punktok136=1
Global punktok137=1
Global punktok138=1
Global punktok139=1
Global punktok140=1
Global punktok141=1
Global punktok142=1
Global punktok143=1
Global punktok144=1
Global punktok145=1
Global punktok146=1
Global punktok147=1
Global punktok148=1
Global punktok149=1
Global punktok150=1
Global punktok151=1
Global punktok152=1
Global punktok153=1
Global punktok154=1
Global punktok155=1
Global punktok156=1
Global punktok157=1
Global punktok158=1
Global punktok159=1
Global punktok160=1
Global punktok161=1
Global punktok162=1
Global punktok163=1
Global punktok164=1
Global punktok165=1
Global punktok166=1
Global punktok167=1
Global punktok168=1
Global punktok169=1
Global punktok170=1
Global punktok171=1
Global alle=0
starttext=1
starttextbc=0
temp1=0
temp3=0
temp4=0
temp5=0
temp6=0
temp7=0
temp8=0
temp9=0
temp10=0
temp11=0
temp12=0
AppTitle "Blockbuster"
;timer
; 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)
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
Include "Hm.bb"
framerate=CreateTimer(frame)
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*27
time6=MilliSecs()
;
temp_time6=1*3
time7=MilliSecs()
;
temp_time7=1*3
time8=MilliSecs()
;
temp_time8=1*3
time9=MilliSecs()
;
temp_time9=1*27
time10=MilliSecs()
;
temp_time10=1*3
time11=MilliSecs()
;Level Laden
PlayCDTrack(track,2)
Select Bild
Case 0
Backgroundimage=LoadImage("HintergrundBilder\Hintergrund.jpg")
Case 1
Backgroundimage=LoadImage("HintergrundBilder\Hintergrund1.jpg")
Case 2
Backgroundimage=LoadImage("HintergrundBilder\Hintergrund2.jpg")
Case 3
Backgroundimage=LoadImage("HintergrundBilder\Hintergrund3.jpg")
Case 4
Backgroundimage=LoadImage("HintergrundBilder\Hintergrund4.jpg")
Case 5
Backgroundimage=LoadImage("HintergrundBilder\Hintergrund5.jpg")
End Select
FreeImage Titel
Dim level$(22,35)
leveldatei$=ReadFile("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("Sounds\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
DrawImage box,spalte*32,zeile*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 lifes=5 Then
DrawImage lifecoins,0,0
DrawImage lifecoins,30,0
DrawImage lifecoins,60,0
DrawImage lifecoins,90,0
DrawImage lifecoins,120,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
;
If temp10=1 Then
If MilliSecs()-time9>1000
temp_time8=temp_time8-1
time9=MilliSecs()
EndIf
EndIf
;
If temp11=1 Then
If MilliSecs()-time10>1000
temp_time9=temp_time9-1
time10=MilliSecs()
EndIf
EndIf
;
If temp12=1 Then
If MilliSecs()-time11>1000
temp_time10=temp_time10-1
time11=MilliSecs()
EndIf
EndIf

Color 100,0,0
Text 550,0,": "+Str(temp_time)+" sek"
DrawImage wecker,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  Punkteplus=1
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 Punkteplus1=1
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 Punkteplus2=1
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 Punkteplus3=1
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(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(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
;Punkte
;Extras     
;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
;
If bloecke(34,2)=0 And mehrlifes1=1  Then
lifes=lifes+1
mehrlifes1=0
EndIf
If Extratextstop5=1 And bloecke(34,2)=0  Then
temp10=1
DrawImage ExtraText2,250,315
EndIf
If temp_time8=0 Then  Extratextstop5=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
If bloecke1(11,2)=0 And  stopextra6=1 Then
temp11=1
If Extratextnicht=1 Then
temp12=1
DrawImage Extratext3,250,350
EndIf
NormalSteurung=0
GetrenntePadel=1
EndIf
If temp_time9=0 Then   GetrenntePadel=0  NormalSteuerung=1 stopextra6=0 x3=330 y3=400 x4=275 y4=396 x=300 y=400
If temp_time10=0 Then  Extratextnicht=0

 
;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
If temp_time1=0 Then BoeckeWiderHerstellen=0
If temp_time2=0 Then Extratextstop=0
EndIf
;Punkte zählen
;grün
If punktok=1 And bloecke(1,2)=0 Then Punkte=Punkte+1 punktok=0
If punktok1=1 And bloecke(2,2)=0 Then Punkte=Punkte+1 punktok1=0
If punktok2=1 And bloecke(3,2)=0 Then Punkte=Punkte+1 punktok2=0
If punktok3=1 And bloecke(5,2)=0 Then Punkte=Punkte+1 punktok3=0
If punktok4=1 And bloecke(6,2)=0 Then Punkte=Punkte+1 punktok4=0
If punktok5=1 And bloecke(7,2)=0 Then Punkte=Punkte+1 punktok5=0
If punktok6=1 And bloecke(8,2)=0 Then Punkte=Punkte+1 punktok6=0
If punktok7=1 And bloecke(9,2)=0 Then Punkte=Punkte+1 punktok7=0
If punktok8=1 And bloecke(10,2)=0Then Punkte=Punkte+1 punktok8=0
If punktok9=1 And bloecke(11,2)=0Then Punkte=Punkte+1 punktok9=0
If punktok10=1And bloecke(12,2)=0Then Punkte=Punkte+1 punktok10=0
If punktok11=1And bloecke(13,2)=0Then Punkte=Punkte+1 punktok11=0
If punktok12=1 And bloecke(14,2)=0 Then Punkte=Punkte+1 punktok12=0
If punktok13=1 And bloecke(15,2)=0 Then Punkte=Punkte+1 punktok13=0
If punktok14=1 And bloecke(16,2)=0 Then Punkte=Punkte+1 punktok14=0
If punktok15=1 And bloecke(17,2)=0 Then Punkte=Punkte+1 punktok15=0
If punktok16=1 And bloecke(18,2)=0 Then Punkte=Punkte+1 punktok16=0
If punktok17=1 And bloecke(19,2)=0 Then Punkte=Punkte+1 punktok17=0
If punktok18=1 And bloecke(20,2)=0 Then Punkte=Punkte+1 punktok18=0
If punktok19=1 And bloecke(21,2)=0 Then Punkte=Punkte+1 punktok19=0
If punktok20=1 And bloecke(22,2)=0 Then Punkte=Punkte+1 punktok20=0
If punktok21=1 And bloecke(23,2)=0 Then Punkte=Punkte+1 punktok21=0
If punktok22=1 And bloecke(24,2)=0 Then Punkte=Punkte+1 punktok22=0
If punktok23=1 And bloecke(25,2)=0 Then Punkte=Punkte+1 punktok23=0
If punktok24=1 And bloecke(26,2)=0 Then Punkte=Punkte+1 punktok24=0
If punktok25=1 And bloecke(27,2)=0 Then Punkte=Punkte+1 punktok25=0
If punktok26=1 And bloecke(28,2)=0 Then Punkte=Punkte+Rnd(10,20) punktok26=0
If punktok27=1 And bloecke(29,2)=0 Then Punkte=Punkte+1 punktok27=0
If punktok28=1 And bloecke(30,2)=0 Then Punkte=Punkte+1 punktok28=0
If punktok29=1 And bloecke(31,2)=0 Then Punkte=Punkte+1 punktok29=0
If punktok30=1 And bloecke(32,2)=0 Then Punkte=Punkte+1 punktok30=0
If punktok31=1 And bloecke(33,2)=0 Then Punkte=Punkte+1 punktok31=0
If punktok32=1 And bloecke(34,2)=0 Then Punkte=Punkte+1 punktok32=0
If punktok33=1 And bloecke(35,2)=0 Then Punkte=Punkte+1 punktok33=0
If punktok34=1 And bloecke(36,2)=0 Then Punkte=Punkte+1 punktok34=0
If punktok35=1 And bloecke(37,2)=0 Then Punkte=Punkte+1 punktok35=0
If punktok36=1 And bloecke(38,2)=0 Then Punkte=Punkte+1 punktok36=0
If punktok37=1 And bloecke(39,2)=0 Then Punkte=Punkte+1 punktok37=0
If punktok38=1 And bloecke(40,2)=0 Then Punkte=Punkte+1 punktok38=0
If punktok39=1 And bloecke(41,2)=0 Then Punkte=Punkte+1 punktok39=0
If punktok40=1 And bloecke(42,2)=0 Then Punkte=Punkte+1 punktok40=0
If punktok41=1 And bloecke(43,2)=0 Then Punkte=Punkte+1 punktok41=0
If punktok42=1 And bloecke(44,2)=0 Then Punkte=Punkte+1 punktok42=0
;
;rosa
If punktok43=1 And bloecke1(0,2)=0 Then Punkte=Punkte+1 punktok43=0
If punktok44=1 And bloecke1(1,2)=0 Then Punkte=Punkte+1 punktok44=0
If punktok45=1 And bloecke1(2,2)=0 Then Punkte=Punkte+1 punktok45=0
If punktok46=1 And bloecke1(3,2)=0 Then Punkte=Punkte+1 punktok46=0
If punktok47=1 And bloecke1(4,2)=0 Then Punkte=Punkte+1 punktok47=0
If punktok48=1 And bloecke1(5,2)=0 Then Punkte=Punkte+2 punktok48=0
If punktok49=1 And bloecke1(6,2)=0 Then Punkte=Punkte+1 punktok49=0
If punktok50=1 And bloecke1(7,2)=0 Then Punkte=Punkte+1 punktok50=0
If punktok51=1 And bloecke1(8,2)=0 Then Punkte=Punkte+1 punktok51=0
If punktok52=1 And bloecke1(9,2)=0 Then Punkte=Punkte+1 punktok52=0
If punktok53=1 And bloecke1(10,2)=0 Then Punkte=Punkte+1 punktok53=0
If punktok54=1 And bloecke1(11,2)=0 Then Punkte=Punkte+1 punktok54=0
If punktok55=1 And bloecke1(12,2)=0 Then Punkte=Punkte+1 punktok55=0
If punktok56=1 And bloecke1(13,2)=0 Then Punkte=Punkte+1 punktok56=0
If punktok57=1 And bloecke1(14,2)=0 Then Punkte=Punkte+1 punktok57=0
If punktok58=1 And bloecke1(15,2)=0 Then Punkte=Punkte+1 punktok58=0
If punktok59=1 And bloecke1(16,2)=0 Then Punkte=Punkte+1 punktok59=0
If punktok60=1 And bloecke1(17,2)=0 Then Punkte=Punkte+1 punktok60=0
If punktok61=1 And bloecke1(18,2)=0 Then Punkte=Punkte+1 punktok61=0
If punktok62=1 And bloecke1(19,2)=0 Then Punkte=Punkte+5 punktok62=0
If punktok63=1 And bloecke1(20,2)=0 Then Punkte=Punkte+1 punktok63=0
If punktok64=1 And bloecke1(21,2)=0 Then Punkte=Punkte+1 punktok64=0
If punktok65=1 And bloecke1(22,2)=0 Then Punkte=Punkte+30 punktok65=0
If punktok66=1 And bloecke1(23,2)=0 Then Punkte=Punkte+1 punktok66=0
If punktok67=1 And bloecke1(24,2)=0 Then Punkte=Punkte+1 punktok67=0
If punktok68=1 And bloecke1(25,2)=0 Then Punkte=Punkte+1 punktok68=0
If punktok69=1 And bloecke1(26,2)=0 Then Punkte=Punkte+1 punktok69=0
If punktok70=1 And bloecke1(27,2)=0 Then Punkte=Punkte+1 punktok70=0
If punktok71=1 And bloecke1(28,2)=0 Then Punkte=Punkte+1 punktok71=0
If punktok72=1 And bloecke1(29,2)=0 Then Punkte=Punkte+1 punktok72=0
If punktok73=1 And bloecke1(30,2)=0 Then Punkte=Punkte+1 punktok73=0
If punktok74=1 And bloecke1(31,2)=0 Then Punkte=Punkte+1 punktok74=0
If punktok75=1 And bloecke1(32,2)=0 Then Punkte=Punkte+1 punktok75=0
If punktok76=1 And bloecke1(33,2)=0 Then Punkte=Punkte+1 punktok76=0
If punktok77=1 And bloecke1(34,2)=0 Then Punkte=Punkte+1 punktok77=0
If punktok78=1 And bloecke1(35,2)=0 Then Punkte=Punkte+1 punktok78=0
If punktok79=1 And bloecke1(36,2)=0 Then Punkte=Punkte+1 punktok79=0
If punktok80=1 And bloecke1(37,2)=0 Then Punkte=Punkte+1 punktok80=0
If punktok81=1 And bloecke1(38,2)=0 Then Punkte=Punkte+1 punktok81=0
If punktok82=1 And bloecke1(39,2)=0 Then Punkte=Punkte+1 punktok82=0
If punktok83=1 And bloecke1(40,2)=0 Then Punkte=Punkte+1 punktok83=0
If punktok84=1 And bloecke1(41,2)=0 Then Punkte=Punkte+1 punktok84=0
If punktok85=1 And bloecke1(42,2)=0 Then Punkte=Punkte+1 punktok85=0
If punktok86=1 And bloecke1(43,2)=0 Then Punkte=Punkte+1 punktok86=0
If punktok87=1 And bloecke1(44,2)=0 Then Punkte=Punkte+1 punktok87=0
If punktok88=1 And bloecke1(45,2)=0 Then Punkte=Punkte+1 punktok88=0
;
;blau
If punktok89=1 And bloecke2(0,2)=0 Then Punkte=Punkte+1 punktok89=0
If punktok90=1 And bloecke2(1,2)=0 Then Punkte=Punkte+1 punktok90=0
If punktok91=1 And bloecke2(2,2)=0 Then Punkte=Punkte+1 punktok91=0
If punktok92=1 And bloecke2(3,2)=0 Then Punkte=Punkte+1 punktok92=0
If punktok93=1 And bloecke2(4,2)=0 Then Punkte=Punkte+1 punktok93=0
If punktok94=1 And bloecke2(5,2)=0 Then Punkte=Punkte+1 punktok94=0
If punktok95=1 And bloecke2(6,2)=0 Then Punkte=Punkte+1 punktok95=0
If punktok96=1 And bloecke2(7,2)=0 Then Punkte=Punkte+1 punktok96=0
If punktok97=1 And bloecke2(8,2)=0 Then Punkte=Punkte+1 punktok97=0
If punktok98=1 And bloecke2(9,2)=0 Then Punkte=Punkte+1 punktok98=0
If punktok99=1 And bloecke2(10,2)=0 Then Punkte=Punkte+1 punktok99=0
If punktok100=1 And bloecke2(11,2)=0 Then Punkte=Punkte+1 punktok100=0
If punktok101=1 And bloecke2(12,2)=0 Then Punkte=Punkte+1 punktok101=0
If punktok102=1 And bloecke2(13,2)=0 Then Punkte=Punkte+1 punktok102=0
If punktok103=1 And bloecke2(14,2)=0 Then Punkte=Punkte+1 punktok103=0
If punktok104=1 And bloecke2(15,2)=0 Then Punkte=Punkte+1 punktok104=0
If punktok105=1 And bloecke2(16,2)=0 Then Punkte=Punkte+1 punktok105=0
If punktok106=1 And bloecke2(17,2)=0 Then Punkte=Punkte+1 punktok106=0
If punktok107=1 And bloecke2(18,2)=0 Then Punkte=Punkte+1 punktok107=0
If punktok108=1 And bloecke2(19,2)=0 Then Punkte=Punkte+1 punktok108=0
If punktok109=1 And bloecke2(21,2)=0 Then Punkte=Punkte+1 punktok109=0
If punktok110=1 And bloecke2(22,2)=0 Then Punkte=Punkte+1 punktok110=0
If punktok111=1 And bloecke2(23,2)=0 Then Punkte=Punkte+1 punktok111=0
If punktok112=1 And bloecke2(24,2)=0 Then Punkte=Punkte+1 punktok112=0
If punktok113=1 And bloecke2(25,2)=0 Then Punkte=Punkte+1 punktok113=0
If punktok114=1 And bloecke2(26,2)=0 Then Punkte=Punkte+Rnd(20,30) punktok114=0
If punktok115=1 And bloecke2(27,2)=0 Then Punkte=Punkte+1 punktok115=0
If punktok116=1 And bloecke2(28,2)=0 Then Punkte=Punkte+1 punktok116=0
If punktok117=1 And bloecke2(29,2)=0 Then Punkte=Punkte+1 punktok117=0
If punktok118=1 And bloecke2(30,2)=0 Then Punkte=Punkte+1 punktok118=0
If punktok119=1 And bloecke2(31,2)=0 Then Punkte=Punkte+1 punktok119=0
If punktok120=1 And bloecke2(32,2)=0 Then Punkte=Punkte+1 punktok120=0
If punktok121=1 And bloecke2(33,2)=0 Then Punkte=Punkte+1 punktok121=0
If punktok122=1 And bloecke2(34,2)=0 Then Punkte=Punkte+1 punktok122=0
If punktok123=1 And bloecke2(35,2)=0 Then Punkte=Punkte+1 punktok123=0
If punktok124=1 And bloecke2(36,2)=0 Then Punkte=Punkte+1 punktok124=0
If punktok125=1 And bloecke2(37,2)=0 Then Punkte=Punkte+35 punktok125=0
If punktok126=1 And bloecke2(38,2)=0 Then Punkte=Punkte+1 punktok126=0
If punktok127=1 And bloecke2(39,2)=0 Then Punkte=Punkte+1 punktok127=0
If punktok128=1 And bloecke2(40,2)=0 Then Punkte=Punkte+1 punktok128=0
If punktok129=1 And bloecke2(41,2)=0 Then Punkte=Punkte+1 punktok129=0
If punktok130=1 And bloecke2(42,2)=0 Then Punkte=Punkte+1 punktok130=0
If punktok131=1 And bloecke2(43,2)=0 Then Punkte=Punkte+1 punktok131=0
If punktok132=1 And bloecke2(44,2)=0 Then Punkte=Punkte+1 punktok132=0
If punktok133=1 And bloecke2(45,2)=0 Then Punkte=Punkte+1 punktok133=0
;
;hellblau
If punktok134=1 And bloecke3(0,2)=0 Then Punkte=Punkte+1 punktok134=0
If punktok135=1 And bloecke3(1,2)=0 Then Punkte=Punkte+1 punktok135=0
If punktok136=1 And bloecke3(2,2)=0 Then Punkte=Punkte+1 punktok136=0
If punktok137=1 And bloecke3(3,2)=0 Then Punkte=Punkte+1 punktok137=0
If punktok138=1 And bloecke3(4,2)=0 Then Punkte=Punkte+1 punktok138=0
If punktok139=1 And bloecke3(5,2)=0 Then Punkte=Punkte+1 punktok139=0
If punktok140=1 And bloecke3(6,2)=0 Then Punkte=Punkte+1 punktok140=0
If punktok141=1 And bloecke3(7,2)=0 Then Punkte=Punkte+1 punktok141=0
If punktok142=1 And bloecke3(8,2)=0 Then Punkte=Punkte+1 punktok142=0
If punktok143=1 And bloecke3(9,2)=0 Then Punkte=Punkte+1 punktok143=0
If punktok144=1 And bloecke3(10,2)=0 Then Punkte=Punkte+1 punktok144=0
If punktok145=1 And bloecke3(11,2)=0 Then Punkte=Punkte+1 punktok145=0
If punktok146=1 And bloecke3(12,2)=0 Then Punkte=Punkte+1 punktok146=0
If punktok147=1 And bloecke3(13,2)=0 Then Punkte=Punkte+1 punktok147=0
If punktok148=1 And bloecke3(14,2)=0 Then Punkte=Punkte+10 punktok148=0
If punktok149=1 And bloecke3(15,2)=0 Then Punkte=Punkte+1 punktok149=0
If punktok150=1 And bloecke3(16,2)=0 Then Punkte=Punkte+1 punktok150=0
If punktok151=1 And bloecke3(17,2)=0 Then Punkte=Punkte+1 punktok151=0
If punktok152=1 And bloecke3(18,2)=0 Then Punkte=Punkte+6 punktok152=0
If punktok153=1 And bloecke3(19,2)=0 Then Punkte=Punkte+1 punktok153=0
If punktok154=1 And bloecke3(20,2)=0 Then Punkte=Punkte+1 punktok154=0
If punktok155=1 And bloecke3(21,2)=0 Then Punkte=Punkte+1 punktok155=0
If punktok156=1 And bloecke3(22,2)=0 Then Punkte=Punkte+5 punktok156=0
If punktok157=1 And bloecke3(23,2)=0 Then Punkte=Punkte+1 punktok157=0
If punktok158=1 And bloecke3(24,2)=0 Then Punkte=Punkte+1 punktok158=0
If punktok159=1 And bloecke3(25,2)=0 Then Punkte=Punkte+1 punktok159=0
If punktok160=1 And bloecke3(26,2)=0 Then Punkte=Punkte+1 punktok160=0
If punktok161=1 And bloecke3(27,2)=0 Then Punkte=Punkte+1 punktok161=0
If punktok162=1 And bloecke3(28,2)=0 Then Punkte=Punkte+1 punktok162=0
If punktok163=1 And bloecke3(29,2)=0 Then Punkte=Punkte+1 punktok163=0
If punktok164=1 And bloecke3(30,2)=0 Then Punkte=Punkte+1 punktok164=0
If punktok165=1 And bloecke3(31,2)=0 Then Punkte=Punkte+1 punktok165=0
If punktok166=1 And bloecke3(32,2)=0 Then Punkte=Punkte+1 punktok166=0
If punktok167=1 And bloecke3(33,2)=0 Then Punkte=Punkte+1 punktok167=0
If punktok168=1 And bloecke3(34,2)=0 Then Punkte=Punkte+1 punktok168=0
If punktok169=1 And bloecke3(35,2)=0 Then Punkte=Punkte+1 punktok169=0
If punktok170=1 And bloecke3(36,2)=0 Then Punkte=Punkte+1 punktok170=0
If punktok171=1 And bloecke3(37,2)=0 Then Punkte=Punkte+1 punktok171=0
Text 300,15,Punkte,0,0
datei1=ReadFile("Hightscore.dat")
Text 260,15,ReadLine(datei1),0,0
CloseFile datei1
;cheat
If KeyDown(32) Then  bloecke(38,2)=0
If KeyDown(50) Then  bloecke1(11,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"
;Hier ist das Fragliche Programm Stück
;chat
If RecvNetMsg()=1
deltime=MilliSecs()
Code=NetMsgType()
Locate 300,0
Select Code
Case 100
Print "Neuer chat Teilnehmer ist beigetreten"
Case 101
Print "Ein chat Teilnehmer hat den chat verlassen"
Case 102
Print "der Host des chats hat den chat verlassen":StopNetGame()
Default
Print NetPlayerName$(NetMsgFrom())+":"+NetMsgData$()
End Select
EndIf
If KeyHit(46)
Locate 0,550
FlushKeys()
Msg$=Input(">>")
FlushKeys()
Locate 0,0
SendNetMsg 1,Msg$,teilnehmer,alle
EndIf
;
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
If soundstop1=1 Then
PlaySound (Losersound)
EndIf
Color 100,0,0
Text 300,250,"Game Over!!!",1,1
soundstop1=0
datei=OpenFile("Hightscore.dat")
WriteLine datei,Punkte
CloseFile datei     
If KeyDown(57)  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
If soundstop2=1 Then
PlaySound (Losersound)
EndIf
Color 100,0,0
Text 300,250,"Game Over!!!",1,1
soundstop2=0
temp1=0
datei2=OpenFile("Hightscore.dat")
WriteLine datei2,Punkte
CloseFile datei2
If KeyDown(57) 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
datei3=OpenFile("Hightscore.dat")
WriteLine datei3,Punkte+100
CloseFile datei3
If soundstop=1 Then
PlaySound (Gewinnsound)
EndIf
soundstop=0
EndIf   
Flip WaitTimer(framerate)
Until KeyDown(1) Or Hpend=1  track=0   End
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

BeitragSa, Feb 14, 2004 13:40
Antworten mit Zitat
Benutzer-Profile anzeigen
Shadow of the night hat Folgendes geschrieben:
Jolinah ich weiss ja nicht wieso, aber bei mir will der Server nicht so recht laufen, ich schau mal nach dem Fehler wenn ich Zeit habe.

MfG Shadow of the Night


Sollte eigentlich, vielleicht liegts auch am client, man muss natürlich die richtige IP eingeben. für den eigenen PC: 127.0.0.1 (entspricht localhost)

Jolinah

BeitragSa, Feb 14, 2004 13:54
Antworten mit Zitat
Benutzer-Profile anzeigen
Zitat:

Ist SendNetMsg in deinem Beispiel Pseudocode oder sind teilnehmer und alle variablen?


Wie ich schon oben gedacht habe liegt es wahrscheinlich daran.

Code: [AUSKLAPPEN]
SendNetMsg 1, Msg$, teilnehmer, alle


Code: [AUSKLAPPEN]
Global alle = 0

alle hast du oben definiert, sollte funktionieren.

Aber teilnehmer hab ich nirgendwo gefunden??
Also wird es vermutlich nie gesendet, dann kommt auch nix an.

Aber da du ja eigentlich gefragt hast wieso nix an kommt (die anderen messages 100,101,102):

Ich habe nirgendwo gesehen das du HostNetGame machst, oder ist das evtl. in ner Include? oder ein Anderes Programm?
Ausserdem muss der Client mit JoinNetGame oder so auch zuerst beitreten. Und ohne das ein Host existiert wird auch nie eine 100, 101, 102 Message versendet soviel ich weiss.
 

sven123

BeitragSa, Feb 14, 2004 18:12
Antworten mit Zitat
Benutzer-Profile anzeigen
JO das ist alles in dieser File
Code: [AUSKLAPPEN]
framrate1=CreateTimer(60)
Hauptmenü=1
Punktok=0
Punktok1=0
Repeat
Cls
weiter=0
If Hauptmenü=1 Then
balldx=MouseX()
balldy=MouseY()
DrawImage Maus,balldx,balldy
Color 250,40,150
SetFont font
Text 300,0,"Fuzzy Intelligence Game production!!!",1,0
DrawImage HauptmenueSchalter1,300,250
DrawImage Ende,300,400
If ImagesCollide(Maus,balldx,balldy,0,Ende,300,400,0)And MouseDown(1) Then
End
EndIf
EndIf
If ImagesCollide(Maus,balldx,balldy,0,HauptmenueSchalter1,300,250,0)And MouseDown(1) Then
zweitesmenü=1
EndIf
If zweitesmenü=1 Then
Cls
Hauptmenü=0
balldx=MouseX()
balldy=MouseY()
DrawImage Maus,balldx,balldy
DrawImage HauptmenueSchalter2,400,350
DrawImage HauptmenueSchalter3,280,200
DrawImage HauptmenueSchalter4,300,250
DrawImage HauptmenueSchalter5,300,300
DrawImage Chatoptionen,250,5
DrawImage Ende,200,350
DrawImage Grafik,50,10
DrawImage Sound,450,10
If ImagesCollide(Maus,balldx,balldy,0,Chatoptionen,250,5,0)And MouseDown(1) Then
chatanfang=1
EndIf
If ImagesCollide(Maus,balldx,balldy,0,Sound,451,10,0)And MouseDown(1) Then
Soundfx=1
EndIf
If ImagesCollide(Maus,balldx,balldy,0,Grafik,50,10,0)And MouseDown(1) Then
Grafikmenü=1
EndIf
If ImagesCollide(Maus,balldx,balldy,0,Ende,200,350,0)And MouseDown(1) Then
End
EndIf 
If ImagesCollide(HauptmenueSchalter3,280,200,0,Maus,balldx,balldy,0) And MouseDown(1) Then
schwirigkeitsgrad=3
Punktok=1
Punktok1=0
Punktok2=0
EndIf
If ImagesCollide(HauptmenueSchalter4,300,250,0,Maus,balldx,balldy,0) And MouseDown(1) Then
schwirigkeitsgrad=2
Punktok1=1
Punktok=0
Punktok2=0
EndIf
If ImagesCollide(HauptmenueSchalter5,300,300,0,Maus,balldx,balldy,0) And MouseDown(1) Then
schwirigkeitsgrad=1
Punktok1=0
Punktok=0
Punktok2=1
EndIf
If Punktok2=1 Then
DrawImage Punkt,325,298
EndIf
If Punktok1=1 Then
DrawImage Punkt,325,249
EndIf
If Punktok=1 Then 
DrawImage Punkt,350,198
EndIf 
If ImagesCollide(HauptmenueSchalter2,400,350,0,Maus,balldx,balldy,0) And MouseDown(1) Then
weiter=1
EndIf
EndIf
;
If Grafikmenü=1 Then
Cls
zweitesmenü=0
Hauptmenü=0
Soundfx=0
balldx=MouseX()
balldy=MouseY()
DrawImage Maus,balldx,balldy
DrawImage Bild1,40,10
DrawImage Bild2,130,10
DrawImage Bild3,220,10
DrawImage Bild4,310,10
DrawImage Bild5,400,10
DrawImage Bild0,490,10
DrawImage zurück,40,450
If ImagesCollide(zurück,40,450,0,Maus,balldx,balldy,0) And MouseDown(1) Then
Grafikmenü=0
zweitesmenü=1
EndIf
If ImagesCollide(Bild1,40,10,0,Maus,balldx,balldy,0) And MouseDown(1) Then
Bild=1
EndIf
If ImagesCollide(Bild2,130,10,0,Maus,balldx,balldy,0) And MouseDown(1) Then
Bild=2
EndIf
If ImagesCollide(Bild3,220,10,0,Maus,balldx,balldy,0) And MouseDown(1) Then
Bild=3
EndIf
If ImagesCollide(Bild4,310,10,0,Maus,balldx,balldy,0) And MouseDown(1) Then
Bild=4
EndIf
If ImagesCollide(Bild5,400,10,0,Maus,balldx,balldy,0) And MouseDown(1) Then
Bild=5
EndIf
If ImagesCollide(Bild0,490,10,0,Maus,balldx,balldy,0) And MouseDown(1) Then
Bild=0
EndIf
Text 300,250,Bild,1,0
EndIf
;
If Soundfx=1 Then
plus2=1
zweitesmenü=0
Hauptmenü=0
Grafikmenü=0
Cls
balldx=MouseX()
balldy=MouseY()
DrawImage Maus,balldx,balldy
DrawImage zurück,40,450
DrawImage Titel1,41,10
DrawImage Titel2,131,10
DrawImage Titel3,221,10
DrawImage Titel4,311,10
DrawImage Titel5,401,10
DrawImage Titel6,491,10
;
DrawImage Titel7,42,40
DrawImage Titel8,132,40
DrawImage Titel9,222,40
DrawImage Titel10,312,40
DrawImage Titel11,402,40
DrawImage Titel12,492,40
DrawImage Titel0,492,70
DrawImage Titel13,42,70
DrawImage Titel14,132,70
DrawImage Titel15,222,70
DrawImage Titel16,312,70
DrawImage Titel17,402,70
Text 320,250,track,1,0
If ImagesCollide(Titel1,41,10,0,Maus,balldx,balldy,0) And MouseDown(1) Then
track=1
EndIf
If ImagesCollide(Titel2,131,10,0,Maus,balldx,balldy,0) And MouseDown(1) Then
track=2
EndIf
If ImagesCollide(Titel3,221,10,0,Maus,balldx,balldy,0) And MouseDown(1) Then
track=3
EndIf
If ImagesCollide(Titel4,311,10,0,Maus,balldx,balldy,0) And MouseDown(1) Then
track=4
EndIf
If ImagesCollide(Titel5,401,10,0,Maus,balldx,balldy,0) And MouseDown(1) Then
track=5
EndIf
If ImagesCollide(Titel6,491,10,0,Maus,balldx,balldy,0) And MouseDown(1) Then
track=6
EndIf
If ImagesCollide(Titel7,42,40,0,Maus,balldx,balldy,0) And MouseDown(1) Then
track=7
EndIf
If ImagesCollide(Titel8,132,40,0,Maus,balldx,balldy,0) And MouseDown(1) Then
track=8
EndIf
If ImagesCollide(Titel9,222,40,0,Maus,balldx,balldy,0) And MouseDown(1) Then
track=9
EndIf
If ImagesCollide(Titel10,312,40,0,Maus,balldx,balldy,0) And MouseDown(1) Then
track=10
EndIf
If ImagesCollide(Titel11,402,40,0,Maus,balldx,balldy,0) And MouseDown(1) Then
track=11
EndIf
If ImagesCollide(Titel12,492,40,0,Maus,balldx,balldy,0) And MouseDown(1) Then
track=12
EndIf
If ImagesCollide(Titel13,42,70,0,Maus,balldx,balldy,0) And MouseDown(1) Then
track=13
EndIf
If ImagesCollide(Titel14,132,70,0,Maus,balldx,balldy,0) And MouseDown(1) Then
track=14
EndIf
If ImagesCollide(Titel15,222,70,0,Maus,balldx,balldy,0) And MouseDown(1) Then
track=15
EndIf
If ImagesCollide(Titel16,312,70,0,Maus,balldx,balldy,0) And MouseDown(1) Then
track=16
EndIf
If ImagesCollide(Titel17,402,70,0,Maus,balldx,balldy,0) And MouseDown(1) Then
track=17
EndIf
If ImagesCollide(Titel0,492,70,0,Maus,balldx,balldy,0) And MouseDown(1) Then
track=0
EndIf
If ImagesCollide(zurück,40,450,0,Maus,balldx,balldy,0) And MouseDown(1) Then
Soundfx=0
zweitesmenü=1
EndIf
EndIf
;
If chatanfang=1 Then
zweitesmenü=0
Hauptmenü=0
Soundfx=0
Grafikmenü=0
Cls
balldx=MouseX()
balldy=MouseY()
DrawImage Maus,balldx,balldy
DrawImage zurück,40,450
DrawImage Host,50,10
DrawImage Join,500,10
If ImagesCollide(zurück,40,450,0,Maus,balldx,balldy,0) And MouseDown(1) Then
Chatanfang=0
zweitesmenü=1
EndIf
If ImagesCollide(Host,50,10,0,Maus,balldx,balldy,0) And MouseDown(1) Then
CountHostIPs("")
ip$=DottedIP$(HostIP(1))
Locate 300,150
Print "IP:"+ip
Locate 300,170
CName=Input$("Chat Name:")
Locate 300,190
TName=Input$("Dein Name:")
HostNetGame(CName)
teilnehmer=CreateNetPlayer(TName)
EndIf
If ImagesCollide(Join,500,10,0,Maus,balldx,balldy,0) And MouseDown(1) Then
Locate 300,150
ip=Input$("IP:")
Locate 300,170
CName=Input$("Chat Name:")
Locate 300,190
TName=Input$("Dein Name:")
JoinNetGame(CName,ip)
teilnehmer=CreateNetPlayer(TName)
EndIf
EndIf
;
Flip WaitTimer(framrate1)
Until weiter=1 Or KeyDown(1)
FreeImage Ende
FreeImage Maus
FreeImage Hauptmenueschalter1
FreeImage Hauptmenueschalter2
FreeImage Hauptmenueschalter3
FreeImage Hauptmenueschalter4
FreeImage Hauptmenueschalter5
FreeImage Punkt
FreeImage Grafik
FreeImage Bild1
FreeImage Bild2
FreeImage Bild3
FreeImage Bild4
FreeImage Bild5
FreeImage Bild0
FreeImage Titel1
FreeImage Titel2
FreeImage Titel3
FreeImage Titel4
FreeImage Titel5
FreeImage Titel0
FreeImage Titel6
FreeImage Titel7
FreeImage Titel8
FreeImage Titel9
FreeImage Titel10
FreeImage Titel0
FreeImage Titel13
FreeImage Titel14
FreeImage Titel15
FreeImage Titel16
FreeImage Titel17
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

Wild-Storm

BeitragSa, Feb 14, 2004 19:42
Antworten mit Zitat
Benutzer-Profile anzeigen
du quälst uns wirklich!!!! Twisted Evil
Benutze doch bitte For-Schleifen Exclamation Exclamation Exclamation Exclamation Exclamation Exclamation Exclamation Wink
Das freeimage ist übrigens unnötig Idea
so was in der art:
user posted image
Visit http://www.next-dimension.org
-------------------------------------------------
Freeware Modelle, Texturen & Sounds:
http://www.blitzforum.de/forum...hp?t=12875

Jolinah

BeitragSo, Feb 15, 2004 19:56
Antworten mit Zitat
Benutzer-Profile anzeigen
Hehe das Bild is cool Wink

Ich weiss ehrlich gesagt nicht woran es liegt. Kann auch sein das ich was übersehen hab.. aber bei diesem langen code Wink

Versuch einfach nochmal alles nachzuprüfen wie es in der Onlinehilfe steht. So ungefähr nach diesem Schema:

Code: [AUSKLAPPEN]

If not HostNetGame("spiel") = 2
  print "Fehler beim Hosten des Games"
  end
Endif

player_id = CreateNetPlayer("Name")

If player_id = 0
  print "Fehler beim erstellen des Spielers"
  end
Endif

Repeat
...

If RecvNetMsg()
  id = NetMsgType()
 
  Select id
    Case 100
      Print "Ein neuer Spieler ist dem Spiel beigetreten."
    Case 101
      Print "Ein Spieler hat das Spiel verlassen."
    Case 102
      Print "Der Host hat das Spiel verlassen, dieser PC ist neuer Host."
    Case 200
      Print "Ein Problem ist aufgetreten, spiel wird beendet.
      DeleteNetPlayer player_id
      StopNetGame()
      End
    Case 1
      txt$ = NetMsgData$()
      from$ = NetMsgFrom()
      Print from$ + ": " + txt$
  End Select
Endif

If keyhit(57) ;Leertaste
  SendNetMsg(1,"Test-Nachricht",player_id,0)
Endif

...
Until Keyhit(1)


Der Code ist jedoch nur für den ersten spieler, da direkt gehostet wird. Der nächste spieler darf nicht hosten, sondern muss JoinNetGame() benutzen. Da liegt vielleicht auch das Problem bei dir.

PS: Was dir Wild-Storm sagen wollte ist wohl das du nicht so viele Variablen hättest machen sollen Wink

z.bsp: Punktok1 - Punktok300 oder so, wäre einfacher nen Array zu machen: Dim Punktok(299) ;0 - 299 = 300

Das ganze kann man dann viel besser in Schleifen bearbeiten:

Code: [AUSKLAPPEN]
;Alle auf 0 setzen.
For i = 0 to 299
  Punktok(i) = 0
Next

Jolinah

BeitragSo, Feb 15, 2004 20:01
Antworten mit Zitat
Benutzer-Profile anzeigen
Wild-Storm hat Folgendes geschrieben:
Das freeimage ist übrigens unnötig Idea


Heisst das alle Bilder werden beim Programm Ende automatisch von Blitz aus dem Speicher entfernt? Wusst ich gar nicht, aber ich habs bisher auch mit ner For Schleife gelöst und die Bilder hab ich in nen Array geladen wenn ich wirklich viele gebraucht hab.

stfighter01

BeitragSo, Feb 15, 2004 21:07
Antworten mit Zitat
Benutzer-Profile anzeigen
es funktionert tatsächlich nicht meldungen an sich selbst, bzw. einen anderen spieler zu senden der am gleichen pc sitzt, oder genauer am GLEICHEN und zwar GANZ GENAU gleichen programm arbeitet.

darum hab ich mir heute eine abhilfe gebastelt Wink
habs ins code archiv gelegt.
sieh mal unter directplay-addon

mfg stfighter
Denken hilft!

Jolinah

BeitragSo, Feb 15, 2004 21:21
Antworten mit Zitat
Benutzer-Profile anzeigen
Ich hab mir deinen Code mal angesehen. Hab aber mal was eigenes gemacht und getestet. Funktioniert wunderbar im lokalen Netzwerk, sogar auf dem eigenen PC. Natürlich wird nicht an sich selber gesendet (das selbe Programm) weil das meiner Meinung nach völlig sinnlos ist.


Dieser Code ist nur für den eigenen PC "127.0.0.1" und entscheidet selbst ob Host oder Join. Bei mir funktioniert das jedenfalls ohne Probs.
Mit Leertaste kann eine Test Meldung versendet werden.

Code: [AUSKLAPPEN]

AppTitle "NetGame"

If JoinNetGame("spiel","127.0.0.1") = 0

   Print "Kein Host vorhanden, dieser PC wird host."

   If HostNetGame("spiel") <> 2
      Print "Fehler beim erstellen des Spiels. Ende!"
      WaitKey()
      End
   Else
      Print "Spiel wurde erstellt (Host)."
   EndIf

Else
   Print "Host gefunden und verbunden."
EndIf



SeedRnd MilliSecs()
player_name$ = "Spieler" + Rand(0,1000)
player_id = CreateNetPlayer(player_name$)


If player_id = 0
   Print "Fehler beim erstellen des Spielers. Ende!"
   WaitKey()
   End
Else
   Print "Spieler mit dem Namen " + player_name$ + " wurde erstellt."
EndIf


Repeat

   If RecvNetMsg()
      id = NetMsgType()
      
      Select id
         Case 100
            Print NetPlayerName$(NetMsgFrom()) + " ist dem Spiel beigetreten."
         Case 101
                ;So kann man nicht genau rausfinden wer das Spiel verlassen hat
            ;NetPlayerName$(NetMsgFrom()) liefert <unknown> zurück.
            ;Geregelt mit eigener Message 2.
         Case 102
            Print "Kein Host mehr, du bist jetzt Host."
         Case 200
            Print "Ein Fehler ist aufgetreten, Ende!"
            WaitKey()
            DeleteNetPlayer player_id
            StopNetGame()
            End
         Case 1
            Print NetPlayerName$(NetMsgFrom()) + ": " + NetMsgData$()
         Case 2
            Print NetPlayerName$(NetMsgFrom()) + " hat das Spiel verlassen."
         Default
            Print "Unbekannte Message eingetroffen:"
            Print "Von: " + NetPlayerName$(NetMsgFrom())
            Print "Zu: " + NetPlayerName$(NetMsgTo())
            Print "Inhalt: " + NetMsgData$()
            WaitKey()
      End Select
      
   EndIf
   
   If KeyHit(57)
      SendNetMsg 1,"Test von " + player_name$, player_id, 0
   EndIf
   

Until KeyHit(1)

SendNetMsg 2, "Exit", player_id, 0

DeleteNetPlayer player_id
StopNetGame()

End


Das funktioniert auch wenn es nicht der lokale PC ist wenn man die IP halt abändert. Es wird zuerst versucht dem Spiel beizutreten, wenn es nicht erfolgreich war wird selber ein Server erstellt (gehostet).

Ich hab grad gesehen wie langsam das Direct Play ist, ich persönlich bevorzuge UDP, oder wenn es halt wichtig ist das die Daten auch korrekt ankommen TCP. Aber meistens funktioniert auch ein UDP Chat recht zuverlässig, ich hab jedenfalls noch nie fehlerhafte Daten übermittelt bekommen wo ich zwischen meinem PC und dem Laptop getestet habe.

stfighter01

BeitragSo, Feb 15, 2004 22:47
Antworten mit Zitat
Benutzer-Profile anzeigen
naja es nicht natürlich nicht UNBEDIGT erforderlich das directplay von eigenen programm ins eigene programm meldungen verschicken kann, da die daten ja sowieso in irgendeiner form vorliegen müssen.
für mich ist es aber trotzdem praktisch, denn stell dir eines vor.

alle spieler melden sich im netzwerk am host an.
nur 2 spieler nicht, denn die sitzen am selben pc auf dem der host läuft.
jetzt müsste man also für diese 2 spieler eine komplette logon routine schreiben, und das ist mühsam.
so schicken sie die gleichen daten zum gleichen empfänger wie die anderen und sind auch angemeldet Wink

oder auch beim chat programm sinnvoll.
man braucht z.b.: nur ein eingangsfenster, und das verarbeitet alle aus dem netz kommenden informationen gleich (ausgabe am bildschirm).
find ich einfacher wie getrennte verarbeitung.

mfg stfighter

:Edit
btw.: udp schickt auch keine fehlerhaften daten, es kann lediglich manchmal vorkommen das ganze datenpakete verloren gehen
(kann schlecht sein wenn das genau bei einem login passiert)
Denken hilft!

Jolinah

BeitragSo, Feb 15, 2004 23:48
Antworten mit Zitat
Benutzer-Profile anzeigen
stfighter01 hat Folgendes geschrieben:

alle spieler melden sich im netzwerk am host an.
nur 2 spieler nicht, denn die sitzen am selben pc auf dem der host läuft.
jetzt müsste man also für diese 2 spieler eine komplette logon routine schreiben, und das ist mühsam.
so schicken sie die gleichen daten zum gleichen empfänger wie die anderen und sind auch angemeldet Wink



Aber startet normalerweise nicht jeder Spieler eine eigene Programm Instanz? Wink
Von daher ist es echt unnötig, oder dann hab ich dich missverstanden.

Da kann eine Instanz der host sein, und die nächsten zwei sind normale clients. Ich kann mir nicht vorstellen das 3 Spieler an ein und der selben Programm Instanz an einem PC sitzen Very Happy

Du hast wohl eher gemeint sachen von einem PC auf den selben PC zu senden, jedoch zu einer anderen Programm Instanz. Dazu benötigt es aber meines Wissens keine speziellen Befehle. Bei mir hat jedenfalls der Code oben funktioniert ohne deine Befehle aus dem Code Archiv zu nutzen Wink Und da hab ich auch an meinen eigenen PC Daten versendet.

D2006

Administrator

BeitragMo, Feb 16, 2004 1:46
Antworten mit Zitat
Benutzer-Profile anzeigen
[OT]man, dass ist wohl der erste Thread den ich kenne, wo eine Seite sooo lang ist, dass die Desgin Elemente bereits aufhören ... *tZ[/OT]

MfG

stfighter01

BeitragMo, Feb 16, 2004 21:39
Antworten mit Zitat
Benutzer-Profile anzeigen
nein, ich mein schon das 2 (od. mehr) spieler am selben pc (gleiche programm instanz) sitzen, mittels splitt screen etwa.
dann gibt es einen pccontroll player der mitteilungen vom host entgegennimmt (bezüglich leveländerung usw.)
und noch alle spieler die eigenständig agieren können.
dann kann man für ALLE spieler, sowohl die am pc wo der host sitzt, als auch an allen verbundenen pcs die selbe logon routine verwenden.
bei einem spieler ist das kein problem, da dieser spieler gleichzeitig host
ist und nix an sich schicken muss.
bei mehreren an einem pc muss der host zu allen spielern infos senden, so auch zu allen lokalen (also müsste man extra abchecken wieviele lokal sitzen usw.)

mfg stfighter
Denken hilft!

Jolinah

BeitragDi, Feb 17, 2004 1:59
Antworten mit Zitat
Benutzer-Profile anzeigen
Ein Splitscreen game das trotzdem per Internet Multiplayer kann meinst du? Also so das z.bsp immer 2 an einem Prog/PC sitzen aber dennoch mehrere PC's im einsatz sind?

Ja in so nem Fall kann ich es schon irgendwie verstehen. Wäre aber trotzdem besser ohne Netzwerk Kommunikation.

Naja ich denke das wird langsam bisschen offtopic Very Happy

stfighter01

BeitragDi, Feb 17, 2004 22:12
Antworten mit Zitat
Benutzer-Profile anzeigen
ja so wärs gedacht.
aber auch zur vereinfachung z.b.: in einem chatprogram ists wie gesagt sinnvoll
schiesslich sollen alle meldungen die man bekommt im grossen textfenster drinstehen (inklusive der eigenen) und was würde sich besser anbieten als diese meldung gleich auch an sich zu schicken? (was eben nur im lokalen netz möglich ist)

mfg stfighter

p.s.: off topic wär eine gute idee (und ein bisschen stutzen wär wohl auch nicht schlecht Smile
Denken hilft!

Jolinah

BeitragMi, Feb 18, 2004 13:56
Antworten mit Zitat
Benutzer-Profile anzeigen
Zitat:
und was würde sich besser anbieten als diese meldung gleich auch an sich zu schicken?


Ich habs bis jetzt immer so gemacht: Um was im Chat Fenster einzufügen ne Funktion machen. Kommt der Text von anderen per Netzwerk dann benutz ich die Funktion eben mit den Daten vom Netzwerk. Und wenn ich selber schreibe dann schicke ich nur an die anderen (bzw. den server). Und benutze die Funktion mit meinem Namen und Text den ich ja sowieso den anderen schicken muss. Ich find das überflüssig mit dem senden per Netzwerk. Es ist ja nicht so ein grosser aufwand einen einzigen Funktionsaufruf mehr zu machen beim Senden einer Nachricht von mir aus zu den anderen.

Mit deiner Lösung müsste man ja zuerst diese Funktionen die du gepostet hast zuerst deklarieren und benutzen. Ist insgesamt viel mehr Code als wenn man ne Funktion benutzt die man ja eh schon benutzt beim Empfangen von Nachrichten.
 

BIG BUG

BeitragMi, Feb 18, 2004 14:29
Antworten mit Zitat
Benutzer-Profile anzeigen
Wird beim "an sich selbst senden" das Netzwerk überhaupt belastet? Könnte ja sein, dass DirectPlay die Daten hier sowieso nur lokal austauscht.
B3D-Exporter für Cinema4D!(V1.4)
MD2-Exporter für Cinema4D!(final)

Gehe zu Seite 1, 2  Weiter

Neue Antwort erstellen


Übersicht BlitzBasic Allgemein

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group