Verfasst: 18.01.2006 17:54
Code: Alles auswählen
DisplayTransparentSprite(AniFrame, position_x, position_y)Das deutsche PureBasic-Forum
https://www.purebasic.fr/german/
Code: Alles auswählen
DisplayTransparentSprite(AniFrame, position_x, position_y)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
EndIf
If LoadSprite(1,"Fighter1.bmp",0)=0
EndIf
position_x = 0
position_y = 0
Repeat
If IsScreenActive()
ClearScreen(0,0,0)
DisplayTransparentSprite(AniFrame, x, y)
FlipBuffers()
Delay(200)
AniFrame + 1
If AniFrame => 1 : AniFrame = 0 : EndIf
EndIf
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
If position_x < 0
position_x = 0
EndIf
EndIf
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(AniFrame, position_x, position_y)
If KeyboardPushed(#PB_Key_Escape)
End
EndIf
ForEver
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
EndIf
If LoadSprite(1,"Fighter1.bmp",0)=0
EndIf
position_x = 0
position_y = 0
Repeat
If IsScreenActive()
ClearScreen(0,0,0)
DisplayTransparentSprite(AniFrame, x, y) ;<--------------------------------------------------------
FlipBuffers()
Delay(200)
AniFrame + 1
If AniFrame => 1 : AniFrame = 0 : EndIf
EndIf
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
If position_x < 0
position_x = 0
EndIf
EndIf
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(AniFrame, position_x, position_y)
If KeyboardPushed(#PB_Key_Escape)
End
EndIf
ForEver 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,"C:\Dokumente und Einstellungen\Udo\Eigene Dateien\Eigene Bilder\Desktopback\MandelbrotPic004.bmp",0)=0
EndIf
If LoadSprite(1,"C:\Dokumente und Einstellungen\Udo\Eigene Dateien\Eigene Bilder\Desktopback\MandelbrotPic005.bmp",0)=0
EndIf
position_x = 0
position_y = 0
Repeat
If IsScreenActive()
ClearScreen(0,0,0)
DisplayTransparentSprite(AniFrame, position_x, position_y)
FlipBuffers()
If delay<0
AniFrame + 1
If AniFrame > 1 : AniFrame = 0 : EndIf
delay=100
Else
delay-1
EndIf
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
If position_x < 0
position_x = 0
EndIf
EndIf
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
If KeyboardPushed(#PB_Key_Escape)
End
EndIf
Else
Delay(20)
EndIf
ForEver 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
EndIf
If LoadSprite(1,"Fighter1.bmp",0)=0
EndIf
If LoadSprite(2,"Fighter2.bmp",0)=0
EndIf
If LoadSprite(3,"Fighter3.bmp",0)=0
EndIf
If LoadSprite(4,"Fighter4.bmp",0)=0
EndIf
position_x = 0
position_y = 0
Repeat
If IsScreenActive()
ClearScreen(0,0,0)
DisplayTransparentSprite(AniFrame, position_x, position_y)
FlipBuffers()
If delay<60
AniFrame + 1
If AniFrame > 5 : AniFrame = 0 : EndIf
delay=100
Else
delay-1
EndIf
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
If position_x < 0
position_x = 0
EndIf
EndIf
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
If KeyboardPushed(#PB_Key_Escape)
End
EndIf
Else
Delay(200)
EndIf
ForEver
Code: Alles auswählen
Repeat
If IsScreenActive()
ClearScreen(0,0,0)
DisplayTransparentSprite(AniFrame, position_x, position_y)
FlipBuffers()
; If delay<60
; AniFrame + 1
; If AniFrame > 4 : AniFrame = 0 : EndIf
; delay=100
; Else
; delay-1
; EndIf
ExamineKeyboard()
If KeyboardReleased(#PB_Key_PageDown)
AniFrame+1
If AniFrame >4
AniFrame=0
EndIf
EndIf
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
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
If KeyboardPushed(#PB_Key_Escape)
End
EndIf
Else
Delay(20)
EndIf
ForEver