Danke für die Blumen, wenn du aber anfängst alles nur zusammen zu fragen:
www.rentacoder.com
Gibt nämlich auch Leute, die besseres zu tun haben
Code: Alles auswählen
For Num = 0 To 9 ;Laden der Sprites, 10 Sprites
LoadSprite(Num, "Sprite"+Str(Num)+".bmp") ;Sprite0.bmp, Sprit1.bmp, usw. bis Sprite9.bmp
Next
Repeat
ClearScreen(0, 0, 0)
DisplaySprite(AniFrame, X, Y)
FlipBuffers()
Delay(200)
AniFrame + 1
If AniFrame => 9 : AniFrame = 0 : EndIf
Until KeyboardPushed(#PB_Key_Escape)Du machst mehrere Bilder/Frames in ein Bild rein undJaniboy hat geschrieben:wie bekomm ich eine Animation hin?
Was dir dabei klar sein muss: ClipSprite selbst stellt dein Sprite nicht dar. Erst die DisplaySprite funktionen zeigen den Ausschnitt des Sprites.Danilo hat geschrieben:Du machst mehrere Bilder/Frames in ein Bild rein und
benutzt dann ClipSprite um nur einen Teil darzustellen.
Code: Alles auswählen
If InitSprite()=0
EndIf
If InitKeyboard()=0
EndIf
If InitSprite3D()=0
EndIf
If InitMouse()=0
EndIf
If OpenScreen(640, 480, 16, "Mein Spiel")=0
EndIf
For Num = 0 To 2
If LoadSprite(1, "Hamster1.bmp" ,0)=0
If LoadSprite(2, "Hamster2.bmp" ,0)=0
If LoadSprite(3, "Hamster3.bmp" ,0)=0
Repeat
If IsScreenActive()
ClearScreen(0,0,0)
DisplaySprite(AniFrame, X, Y)
FlipBuffers()
Delay(200)
AniFrame + 1
If AniFrame => 3 : AniFrame = 0 : EndIf
DisplayTransparentSprite(1, x, y)
TransparentSpriteColor(1, 255, 255, 255)
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Left)
x-1
EndIf
If KeyboardPushed(#PB_Key_Right)
x+1
EndIf
If KeyboardPushed(#PB_Key_F5)
x+13
EndIf
If KeyboardPushed(#PB_Key_F6)
y-13
x+13
EndIf
If KeyboardPushed(#PB_Key_F7)
RotateSprite3D(1, 180, 0)
EndIf
EndIf
Until KeyboardPushed(#PB_KEY_ESCAPE)Code: Alles auswählen
For Num = 0 To 2 Code: Alles auswählen
If LoadSprite(0, "Hamster1.bmp" ,0)=0
EndIf
If LoadSprite(1, "Hamster2.bmp" ,0)=0
EndIf
If LoadSprite(2, "Hamster3.bmp" ,0)=0
EndIf
Code: Alles auswählen
Repeat
If IsScreenActive()
ClearScreen(0,0,0)
DisplaySprite(AniFrame, X, Y)
FlipBuffers()
Delay(200)
AniFrame + 1
If AniFrame => 3 : AniFrame = 0 : EndIf
DisplayTransparentSprite(1, x, y)
TransparentSpriteColor(1, 255, 255, 255)
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Left)
x-1
EndIf
If KeyboardPushed(#PB_Key_Right)
x+1
EndIf
If KeyboardPushed(#PB_Key_F5)
x+13
EndIf
If KeyboardPushed(#PB_Key_F6)
y-13
x+13
EndIf
If KeyboardPushed(#PB_Key_F7)
RotateSprite3D(1, 180, 0)
EndIf
EndIf
Until KeyboardPushed(#PB_KEY_ESCAPE)Code: Alles auswählen
TransparentSpriteColor(0, 255, 255, 255)
TransparentSpriteColor(1, 255, 255, 255)
TransparentSpriteColor(2, 255, 255, 255)
Repeat
If IsScreenActive()
ClearScreen(0,0,0)
DisplayTransparentSprite(AniFame, x, y)
FlipBuffers()
Delay(200)
AniFrame + 1
If AniFrame => 2 : AniFrame = 0 : EndIf
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Left)
x-1
EndIf
If KeyboardPushed(#PB_Key_Right)
x+1
EndIf
If KeyboardPushed(#PB_Key_F5)
x+13
EndIf
If KeyboardPushed(#PB_Key_F6)
y-13
x+13
EndIf
If KeyboardPushed(#PB_Key_F7)
;RotateSprite3D(1, 180, 0) ; Was willst du hier mit einem Sprite-3D-Befehle? ... du hast überhaupt kein Sprite3D ...
EndIf
EndIf
Until KeyboardPushed(#PB_KEY_ESCAPE)
Code: Alles auswählen
DisplayTransparentSprite(1, x, y)Code: Alles auswählen
DisplayTransparentSprite(AniFame, x, y)