Anzeige des Sprites funktioniert nicht!
Verfasst: 17.01.2006 18:19
Hallo leute, nachdem ich einige zeit aufgehört hatte, habe ich nun noch einmal mit der programmierung begonnen, doch jedtzt gibts wieder probleme
.
Das ist der Code:
Es wird aber nur schwarz angezeigt und teilweise bricht er sofort wieder ab, der debugger zeigt aber nichts an.
Was ist falsch, könnt ihr mit helfen?
Danke im Vorraus,
Janiboy[/code]
Das ist der Code:
Code: Alles auswählen
If InitSprite() = 0
MessageRequester("Fehler","Konnte dx nicht finden",0)
EndIf
If InitKeyboard()=0
MessageRequester("Fehler","Konnte dx nicht finden",0)
EndIf
If OpenScreen(800,600,32,"Vollbild") = 0
MessageRequester("Fehler","Konnte kein Vollbild erstellen ",0)
EndIf
If LoadSprite(0,"Fighter.bmp",0)=0
x = 4
y = 363
EndIf
position_x = 0
position_y = 0
Repeat
FlipBuffers()
ClearScreen(0, 0,0)
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Right)
position_x + 5
If position_x > 700
position_x = 700
EndIf
EndIf
If KeyboardPushed(#PB_Key_Left)
position_x - 5
position_x = 0
EndIf
End
If KeyboardPushed(#PB_Key_Up)
position_y - 5
If position_y < 0
position_y = 0
EndIf
EndIf
If KeyboardPushed(#PB_Key_Down)
position_y + 5
If position_y > 500
position_y = 500
EndIf
EndIf
DisplayTransparentSprite(0,position_x,position_y)
If KeyboardPushed(#PB_Key_Escape)
End
EndIf
ForEver Es wird aber nur schwarz angezeigt und teilweise bricht er sofort wieder ab, der debugger zeigt aber nichts an.
Was ist falsch, könnt ihr mit helfen?
Danke im Vorraus,
Janiboy[/code]