

Ich suche jetzt schon einige Stunden nach dem Fehler leider ohne Erfolg.

Code: Alles auswählen
InitSprite()
InitKeyboard()
InitMouse()
InitMovie()
InitSound()
Global korbX.w
Global korbY.w
Global Speed.w
Global Level.w
Global eix.w
Global eiy.w
Global Punkte.w
korbX = position_x
korbY= position_y
Level = 1
eiX = 310
eiY = 40
OpenScreen (800,600,16,"Voll bild")
; Laden der Graphiken
LoadSprite(1,"F:\Dokumente und Einstellungen\will ich net angeben\Desktop\Basic\eigen bilder\ei.bmp",0)
LoadMovie(0,"files\we.mid")
PlayMovie (0,0)
LoadSprite(0,"F:\Dokumente und Einstellungen\will ich net angeben\Desktop\ostergame\Bilder\korb.bmp",0)
position_x = 400
position_y = 580
Repeat
ClearScreen(0,255,0)
ExamineKeyboard()
;STEUERUNG
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
If position_x < 0
position_x = 0
EndIf
EndIf
; GRAPHIK
DisplayTransparentSprite(1,eiX,eiY)
DisplayTransparentSprite(0,position_x,position_y)
; BEWEGUNG
eiY = eiY + Speed
; COLLISION
If SpriteCollision(0,position_x,Position_y,0, eix , eiy + 5 ) = 1
Punkte +10
eix = Random(580)
eiY = 0
EndIf
; LEVEL
If (Punkte / 100) + 1 > Level
Level = Level + 1
speed + 1
Punkte + 20
EndIf
If level= 1
speed =3
EndIf
; SCREENOUTPUT
StartDrawing(ScreenOutput())
DrawingMode(1)
Locate(0,0)
FrontColor(0,0,255)
DrawText("Punkte:" + Str(Punkte))
Locate(750,0)
FrontColor(255,0,0)
DrawText("Level:" + Str(Level))
Locate(260,0)
FrontColor(0,200,0)
StopDrawing()
If KeyboardPushed(#PB_Key_Escape)
End
EndIf
FlipBuffers()
Until KeyboardReleased(#PB_Key_Escape):End