Fight Night - Kleine Probleme
Übersicht

![]() |
ValiumBetreff: Fight Night - Kleine Probleme |
![]() Antworten mit Zitat ![]() |
---|---|---|
moin,
habe angefangen ein Boxspiel zu programmieren! Klappt auch super! Jetzt habe ich aber irgentwie einen Anfänger-Fehler und ich komme nicht drauf, wie ichs machen soll! Hier der Code: Code: [AUSKLAPPEN] Graphics 1024,768,32,1
SetBuffer BackBuffer() ; -------------------------------------------- ; - GLOBALE - Backr1 = LoadImage ("C:\Dokumente und Einstellungen\DrValium\Eigene Dateien\Bild667.png") Boxhand = LoadImage ("C:\Dokumente und Einstellungen\DrValium\Eigene Dateien\Bild51.png") Global Create = LoadImage ("D:\Programme\Projekt\create.png") Global Mauszeiger = LoadImage ("D:\Programme\Projekt\maus.png") Global Credits = LoadImage ("D:\Programme\Projekt\credits.png") Global College_font = LoadFont ("College Semi condensed",28) Global Arial_Font_12 = LoadFont ("Arial",12) Global Hintergrund_musik = LoadSound ("D:\test.wav") Global Image = LoadImage ("D:\Programme\Projekt\image.png") Global Image_McNeeley = LoadImage ("D:\Programme\Projekt\Images\Boxer\Mc_neeley.png") ; -------------------------------------------- ; - MENUE - . Hauptmenue PlaySound Hintergrund_musik Repeat ClsColor 1,1,1 Cls DrawImage backr1, 112,84 SetFont Arial_font_12 Color 255,0,0 Text 0,0, "X-Position >" + MouseX() Text 0,15, "Y-Position >" + MouseY() SetFont College_font Color 255,0,0 Text 430,320, "Neues Spiel starten" Text 430,360, "Credits" Text 430,400, "Spiel laden" Text 430,440, "Exit" ; ------------------------------------------- ;- BLINKEN - If MouseX() > 430 And MouseX () < 653 And MouseY() > 320 And MouseY() <343 ; Dunkelrote Schrift, wenn Maus über New Game fährt Color 222, 212, 21 SetFont College_font Text 430,320, "Neues Spiel starten" EndIf If MouseX() > 430 And MouseX () < 505 And MouseY() > 360 And MouseY() <383 ; Dunkelrote Schrift, wenn Maus über New Game fährt Color 222, 212, 21 SetFont College_font Text 430,360, "Credits" EndIf If MouseX() > 430 And MouseX () < 555 And MouseY() > 400 And MouseY() <423 ; Dunkelrote Schrift, wenn Maus über New Game fährt Color 222, 212, 21 SetFont College_font Text 430,400, "Spiel laden" EndIf If MouseX() > 430 And MouseX () < 473 And MouseY() > 440 And MouseY() <462 ; Dunkelrote Schrift, wenn Maus über New Game fährt Color 222, 212, 21 SetFont College_font Text 430,440, "Exit" EndIf ; ------------------------------------------- ;- KLICKFUNCTIONEN - If MouseDown(1) And RectsOverlap (MouseX(),MouseY(),1,1,430,320,224,24) ; Wenn man auf EXIT klickt, wird die include data geöffnet. Create_a_Boxer EndIf If MouseDown(1) And RectsOverlap (MouseX(),MouseY(),1,1,430,360,75,24) ; Wenn man auf EXIT klickt, wird die include data geöffnet. Credits EndIf If MouseDown(1) And RectsOverlap (MouseX(),MouseY(),1,1,430,400,45,24) ; Wenn man auf EXIT klickt, wird die include data geöffnet. Text 50,50, "Hallo" EndIf If MouseDown(1) And RectsOverlap (MouseX(),MouseY(),1,1,430,440,45,24) ; Wenn man auf EXIT klickt, wird die include data geöffnet. End EndIf MaskImage Mauszeiger, 255,0,255 DrawImage Mauszeiger, MouseX(), MouseY() Flip Until KeyHit(1) End ; ------------------------------------------- ;- Create a BOXXXXX0R - Function Create_a_Boxer () Repeat Cls DrawImage Create, 112,84 SetFont Arial_font_12 Color 255,0,0 Text 0,0, "X-Position >" + MouseX() Text 0,15, "Y-Position >" + MouseY() If MouseDown(1) And RectsOverlap (MouseX(),MouseY(),1,1,412,380,252,28) Color 222, 212, 21 SetFont College_font Locate 412, 380 Vorname$ = Input ("") EndIf If MouseDown(1) And RectsOverlap (MouseX(),MouseY(),1,1,412,437,252,28) Color 222, 212, 21 SetFont College_font Locate 412, 437 Nachname$ = Input ("") EndIf If MouseDown(1) And RectsOverlap (MouseX(),MouseY(),1,1,412,492,252,28) Color 222, 212, 21 SetFont College_font Locate 412, 492 Nickname$ = Input ("") EndIf If MouseDown(1) And RectsOverlap (MouseX(),MouseY(),1,1,412,551,252,28) Color 222, 212, 21 SetFont College_font Locate 412, 551 Herkunft$ = Input ("") EndIf Color 222, 212, 21 SetFont College_font Text 540,380, ""+Vorname$ Text 540,551, ""+Herkunft$ Text 540,437, ""+Nachname$ Text 540,492, ""+Nickname$ Color 255,0,0 Text 475,250, "- Zurueck -" Text 475,680, "- Weiter - If MouseX() > 475 And MouseX () < 591 And MouseY() > 680 And MouseY() <703 Color 222, 212, 21 SetFont College_font Text 475,680, "- Weiter -" EndIf If MouseX() > 475 And MouseX () < 608 And MouseY() > 250 And MouseY() <274 Color 222, 212, 21 SetFont College_font Text 475,250, "- Zurueck -" EndIf If MouseDown(1) And RectsOverlap (MouseX(),MouseY(),1,1,475,250,132,24) ; Wenn man auf EXIT klickt, wird die include data geöffnet. Return .Hauptmenue EndIf If MouseDown(1) And RectsOverlap (MouseX(),MouseY(),1,1,475,680,115,24) ; Wenn man auf EXIT klickt, wird die include data geöffnet. Image EndIf MaskImage Mauszeiger, 255,0,255 DrawImage Mauszeiger, MouseX(), MouseY() Flip Until KeyHit (1) End Function ; ------------------------------------------- ;- Credits - Function Credits () Repeat Cls DrawImage Credits, 112,84 MaskImage Mauszeiger, 255,0,255 DrawImage Mauszeiger, MouseX(), MouseY() Flip Until KeyHit (1) End Function ; ------------------------------------------- ;- Chose a Image - Function Image () Repeat Cls DrawImage Image, 112,84 SetFont Arial_font_12 Color 255,0,0 Text 0,0, "X-Position >" + MouseX() Text 0,15, "Y-Position >" + MouseY() If MouseDown(1) And RectsOverlap (MouseX(),MouseY(),1,1,422,453,38,47) ; Wenn man auf EXIT klickt, wird die include data geöffnet. DrawImage Image_McNeeley, 422,190 EndIf MaskImage Mauszeiger, 255,0,255 DrawImage Mauszeiger, MouseX(), MouseY() Flip Until KeyHit (1) End Function Beachtet die Kommentare gar nicht ... Also Es geht um die letzten Zeilen. Ich möchte, dass wenn ich auf einen bestimmten Punkt auf dem Backround klicke, dass ein Bild von einem Boxer angezeigt wird und da auch bleibt, bis ich wieder drauf klicke. Es ist allerdings der Fall, dass wenn ich auf diesen Punkt klicke das das Bild nur solange bleibt, solange ich auf diesem Punkt bin. Hoffe ihr versteht was ich meine, ansonsten mach ich ein kurzes Video oder ein Screenshot ... Danke! Valium |
||
![]() |
maximilian |
![]() Antworten mit Zitat ![]() |
---|---|---|
Nope, das ist kein Fehler. Deine Bedingung lautet: Wenn die Maus gedrückt ist und sich über dem Feld befindet, dann... . Von Bleiben hast du da nichts hingeschrieben. ![]() Code: [AUSKLAPPEN] Local McNeelyShow ;--- vor das Repeat .... If MouseHit(1) And RectsOverlap (MouseX(),MouseY(),1,1,422,453,38,47) ; Wenn man auf EXIT klickt, wird die include data geöffnet. McNeelyShow = 1-McNeelyShow ;---zwischen 1 und 0 hin- und herschalten EndIf If McNeelyShow = 1 Then DrawImage Image_McNeely... |
||
Variety is the spice of life. One day ignore people, next day annoy them. |
![]() |
Valium |
![]() Antworten mit Zitat ![]() |
---|---|---|
Thanks very much!
Hast mir sehr geholfen! |
||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group