Verfasst: 29.06.2005 20:27
und ich glaub ich weiß warum und zwar weil die Transparente Farbe jetzt Schwarz wegtuscht und nicht mehr die Weiße aber das Problem ist das ich nicht weis wie es richtig geht.
Code: Alles auswählen
InitSprite()
InitKeyboard() ; ende der abfrage
OpenScreen(800,600,32,"Vollbild")
LoadSprite(0,"bmp\Player 1\player1 v .bmp",0)
LoadSprite(1,"bmp\Player 1\player1 h .bmp",0)
LoadSprite(2,"bmp\Player 1\player1 l .bmp",0)
LoadSprite(3,"bmp\Player 1\player1 r .bmp",0)
LoadSprite(4,"bmp\Player 1\player1 v g.bmp",0)
LoadSprite(5,"bmp\Player 1\player1 h g.bmp",0)
LoadSprite(6,"bmp\Player 1\player1 l g.bmp",0)
LoadSprite(7,"bmp\Player 1\player1 r g.bmp",0)
position_x1 = 0
position_y1 = 0
TransparentSpriteColor(0, 255, 255, 255)
TransparentSpriteColor(1, 255, 255, 255)
TransparentSpriteColor(2, 255, 255, 255)
TransparentSpriteColor(3, 255, 255, 255)
Repeat
FlipBuffers()
ClearScreen(0,255,255)
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Right)
position_x + 2
If position_x > 760
position_x = 760
EndIf
EndIf
If KeyboardPushed(#PB_Key_Left)
position_x - 2
If position_x < -5
position_x = -5
EndIf
EndIf
If KeyboardPushed(#PB_Key_Up)
position_y - 2
If position_y < -5
position_y = -5
EndIf
EndIf
If KeyboardPushed(#PB_Key_Down)
position_y + 2
If position_y > 560
position_y = 560
EndIf
EndIf
If KeyboardPushed(#PB_Key_Down)
richtung=0
EndIf
If KeyboardPushed(#PB_Key_Up)
richtung=1
EndIf
If KeyboardPushed(#PB_Key_Left)
richtung=2
EndIf
If KeyboardPushed(#PB_Key_Right)
richtung=3
EndIf
Select richtung
Case 0
DisplayTransparentSprite(0,position_x,position_y)
Case 1
DisplayTransparentSprite(1,position_x,position_y)
Case 2
DisplayTransparentSprite(2,position_x,position_y)
Case 3
DisplayTransparentSprite(3,position_x,position_y)
EndSelect
If KeyboardPushed(#PB_Key_Escape)
End
EndIf
ForEver
dann schau dir mal den befehl catchsprite() andund wenn ich schonmal am Fragen bin wie mache ich das wenn ich mehrere Sprites in einem Bild abfragen will.
Dafür musst du die Sprites einfach hintereinander abspielen (oder wie war das jetzt gemeintund wie bringe ich da jetzt noch animation rein
Code: Alles auswählen
Clipsprite(#Sprite, Anim*spritewidth(#Sprite)/3, 0, spritewidth(#Sprite)/3, spriteheight(#Sprite))
Anim + 1
if Anim => 2 : Anim = 0 : endif