Code für Animationen in PB3.3
Verfasst: 12.09.2007 12:34
Kann mir jemand dan code für Animationen geben (bitte PB3.30 tauglich)
Das deutsche PureBasic-Forum
https://www.purebasic.fr/german/
Code: Alles auswählen
For n = 1 to 10
LoadSprite(n, "Bild"+str(n)+".bmp")
Next n
Code: Alles auswählen
Repeat
ClearScreen(0,0,0)
Warten + 1
If Warten > 30 :
Warten = 0
Bild = Bild + 1
If Bild > 10 : Bild = 1 : EndIf
EndIf
DisplaySprite(Bild, x, y)
FlipBUffers()
ForEver
Code: Alles auswählen
InitSprite()
InitKeyboard()
If OpenScreen(640,480,32,"Game")
CreateSprite(0,20,20)
EndIf
LoadSprite(#1,"teil 1.bmp",0)
;hier solls hin
LoadSprite(2, "held1.bmp")
LoadSprite(3, "held2.bmp")
LoadSprite(4, "held3.bmp")
;hier solls hin
Repeat
ExamineMouse()
ExamineKeyboard()
DisplaySprite(#1,0,0)
DisplayTransparentSprite(#2,x1,y1)
If KeyboardPushed(#PB_Key_Up )
;UND HIER SOLLS hin
Y1-1
EndIf
If KeyboardPushed(#PB_Key_Down )
Y1+1
EndIf
If KeyboardPushed(#PB_Key_Left )
X1-1
EndIf
If KeyboardPushed(#PB_Key_Right )
X1+1
EndIf
FlipBuffers()
Until KeyboardPushed(1)
CloseScreen()
Code: Alles auswählen
InitSprite()
InitKeyboard()
If OpenScreen(640,480,32,"Game")
CreateSprite(0,20,20)
EndIf
; LoadSprite(#1,"teil 1.bmp",0)
For n = 1 to 3
LoadSprite(n, "held"+str(n)+".bmp")
Next n
Bild = 1
Repeat
ExamineMouse()
ExamineKeyboard()
ClearScreen(0,0,0)
; DisplaySprite(#1,0,0)
DisplayTransparentSprite(Bild, X1, Y1)
If KeyboardPushed(#PB_Key_Up )
Warten + 1
If Warten > 30 :
Warten = 0
Bild = Bild + 1
If Bild > 3 : Bild = 1 : EndIf
EndIf
Y1-1
EndIf
If KeyboardPushed(#PB_Key_Down )
Y1+1
EndIf
If KeyboardPushed(#PB_Key_Left )
X1-1
EndIf
If KeyboardPushed(#PB_Key_Right )
X1+1
EndIf
FlipBuffers()
Until KeyboardPushed(1)
CloseScreen()
Code: Alles auswählen
For n = 1 To 3
LoadSprite(n, "held"+Str(n)+".bmp")
Next n
Bild = 1
Code: Alles auswählen
For n = 1 To 3
LoadSprite(n, "held"+Str(n)+".bmp")
Next n
Bild = 1
For n = 1 To 3
LoadSprite(n, "held1"+Str(n)+".bmp")
Next n
Bild = 2
For n = 1 To 3
LoadSprite(n, "held2"+Str(n)+".bmp")
Next n
Bild = 3