OK... dann hier der Komplette Code... ist aber ein wenig lang...
Code: Alles auswählen
If InitSprite() = 0
EndIf
If InitKeyboard() = 0
EndIf
If InitMouse() = 0
EndIf
If InitSound() = 0
EndIf
SetRefreshRate(60)
If OpenScreen(800,600,16,"DB") = 0
EndIf
SetFrameRate(60)
;--------------Loading----------------;
OpenPack("data\tex\intro.mtp")
CatchSprite(0,NextPackFile()) ;micro.bmp
CatchSprite(1,NextPackFile()) ;ndesign.bmp
CatchSprite(2,NextPackFile()) ;spacecom.bmp
CatchSprite(3,NextPackFile(),#PB_Sprite_Memory) ;micro2.bmp
ClosePack()
OpenPack("data\tex\menu.mtp")
CatchSprite(4,NextPackFile(),#PB_Sprite_Memory) ;menu1.bmp
CatchSprite(5,NextPackFile()) ;ng1.bmp
CatchSprite(6,NextPackFile()) ;ng2.bmp
CatchSprite(7,NextPackFile()) ;cursor1.bmp
CatchSprite(8,NextPackFile()) ;cursor2.bmp
CatchSprite(9,NextPackFile()) ;o1.bmp
CatchSprite(10,NextPackFile()) ;o2.bmp
CatchSprite(11,NextPackFile()) ;c1.bmp
CatchSprite(12,NextPackFile()) ;c2.bmp
CatchSprite(13,NextPackFile()) ;e1.bmp
CatchSprite(14,NextPackFile()) ;e2.bmp
ClosePack()
OpenPack("data\tex\game.mtp")
CatchSprite(15,NextPackFile()) ;ba.bmp
CatchSprite(16,NextPackFile()) ;bl.bmp
CatchSprite(17,NextPackFile()) ;bm.bmp
CatchSprite(18,NextPackFile()) ;br.bmp
ClosePack()
;--------------Loading Ende-----------;
;-----------------Intro---------------;
e = -600
f = -200
g = 800
Repeat
ExamineKeyboard()
ExamineMouse()
FlipBuffers()
ClearScreen(0,0,0)
DisplaySprite(0,0,e)
DisplaySprite(1,f,400)
DisplaySprite(2,g,400)
e + 2
If e > 0
e-2
f+2
g-2
EndIf
If f > 150
f-2
EndIf
If g < 450
g+2
EndIf
If KeyboardPushed(#PB_Key_escape)
Gosub main
EndIf
If e = 0
If f = 150
If g = 450
Gosub change
EndIf
EndIf
EndIf
ForEver
change:
z=255
Repeat
ExamineKeyboard()
ExamineMouse()
FlipBuffers()
ClearScreen(0,0,0)
DisplayTranslucideSprite(3,0,0,z)
z - 5
If KeyboardPushed(#PB_Key_escape)
End
EndIf
If z = 0
Gosub main
EndIf
ForEver
;---------------------Intro Ende---------------------;
;----------------------Hauptmenü---------------------;
main:
z=0
Repeat
ExamineKeyboard()
ExamineMouse()
FlipBuffers()
ClearScreen(0,0,0)
StartSpecialFX()
DisplayTranslucideSprite(4,0,0,z)
StopSpecialFX()
DisplaySprite(5,295,190)
DisplaySprite(9,295,250)
DisplaySprite(11,295,310)
DisplaySprite(13,295,370)
If SpriteCollision(5,295,190,7,x,y)
DisplaySprite(6,295,190)
If MouseButton(1)
Gosub test
EndIf
EndIf
If SpriteCollision(9,295,250,7,x,y)
DisplaySprite(10,295,250)
EndIf
If SpriteCollision(11,295,310,7,x,y)
DisplaySprite(12,295,310)
EndIf
If SpriteCollision(13,295,370,7,x,y)
DisplaySprite(14,295,370)
If MouseButton(1)
End
EndIf
EndIf
StartDrawing(ScreenOutput())
DrawingMode(1)
FrontColor(150,150,150)
Locate(10,580)
DrawText("Version: 0.1b")
StopDrawing()
x = MouseX()
y = MouseY()
DisplaySprite(7,x,y)
TransparentSpriteColor(8,255,255,255)
DisplayTransparentSprite(8,x,y)
z + 5
If z > 255
z-5
EndIf
If KeyboardPushed(#PB_Key_escape)
End
EndIf
ForEver
;-------------------------Hauptmenü Ende------------------;
;--------------------------Testprogramm-------------------;
test:
a=335
b=544
s=0
c=5
d=5
x=0
y=0
z=0
Repeat
ExamineKeyboard()
ExamineMouse()
FlipBuffers()
ClearScreen(0,0,0)
x = MouseX()
y = 575
TransparentSpriteColor(16,0,0,0)
TransparentSpriteColor(18,0,0,0)
DisplayTransparentSprite(16,x,y)
DisplaySprite(17,x+50,y)
DisplayTransparentSprite(18,x+100,y)
TransparentSpriteColor(15,255,255,255)
DisplayTransparentSprite(15,a,b)
If SpritePixelCollision(16,x,y,15,a,b)
If d=10
d=0
EndIf
If d=9
d=1
EndIf
If d=8
d=2
EndIf
If d=7
d=3
EndIf
If d=6
d=4
EndIf
If c=0
c-1
EndIf
If c=1
c-1
EndIf
If c=2
c-1
EndIf
If c=3
c-1
EndIf
If c=4
c-1
EndIf
If c=5
c-1
EndIf
If c=6
c-1
EndIf
If c=7
c-1
EndIf
If c=8
c-1
EndIf
If c=9
c-1
EndIf
If c=10
c-1
EndIf
If c<0
c+1
EndIf
z+1
EndIf
If SpritePixelCollision(17,x+50,y,15,a,b)
If d=10
d=0
EndIf
If d=9
d=1
EndIf
If d=8
d=2
EndIf
If d=7
d=3
EndIf
If d=6
d=4
EndIf
z+1
EndIf
If SpritePixelCollision(18,x+100,y,15,a,b)
If d=10
d=0
EndIf
If d=9
d=1
EndIf
If d=8
d=2
EndIf
If d=7
d=3
EndIf
If d=6
d=4
EndIf
If c=10
c+1
EndIf
If c=9
c+1
EndIf
If c=8
c+1
EndIf
If c=7
c+1
EndIf
If c=6
c+1
EndIf
If c=5
c+1
EndIf
If c=4
c+1
EndIf
If c=3
c+1
EndIf
If c=2
c+1
EndIf
If c=1
c+1
EndIf
If c=0
c+1
EndIf
If c>10
c-1
EndIf
z+1
EndIf
If KeyboardPushed(#PB_Key_space)
If s=0
c = Random(10)
d = 1
s + 1
EndIf
EndIf
If c=0
a-5
EndIf
If c=1
a-4
EndIf
If c=2
a-3
EndIf
If c=3
a-2
EndIf
If c=4
a-1
EndIf
If c=5
a+0
EndIf
If c=6
a+1
EndIf
If c=7
a+2
EndIf
If c=8
a+3
EndIf
If c=9
a+4
EndIf
If c=10
a+5
EndIf
If d=0
b-5
EndIf
If d=1
b-4
EndIf
If d=2
b-3
EndIf
If d=3
b-2
EndIf
If d=4
b-1
EndIf
If d=5
b+0
EndIf
If d=6
b+1
EndIf
If d=7
b+2
EndIf
If d=8
b+3
EndIf
If d=9
b+4
EndIf
If d=10
b+5
EndIf
If a <= 0
If c=0
c=10
EndIf
If c=1
c=9
EndIf
If c=2
c=8
EndIf
If c=3
c=7
EndIf
If c=4
c=6
EndIf
EndIf
If a >= 600
If c=10
c=0
EndIf
If c=9
c=1
EndIf
If c=8
c=2
EndIf
If c=7
c=3
EndIf
If c=6
c=4
EndIf
EndIf
If b <= 0
If d=0
d=10
EndIf
If d=1
d=9
EndIf
If d=2
d=8
EndIf
If d=3
d=7
EndIf
If d=4
d=6
EndIf
EndIf
If KeyboardPushed(#PB_Key_escape)
End
EndIf
ForEver
;---------------------------Testprogramm Ende-----------------------;
Ich hoffe ihr könnt mir da weiterhelfen...
Also der Fehler tritt im Bereich des "Testprogramm" auf... die Bilder 15,16,17 und 18 werden einfach durch die Bilder 0,1,2 und 3 ersetzt.