animation

Übersicht BlitzBasic Allgemein

Neue Antwort erstellen

sector

Betreff: animation

BeitragSo, März 14, 2004 15:49
Antworten mit Zitat
Benutzer-Profile anzeigen
Hi,

haltet mich ruhig für etwas dämlich aber ich komm net druff.
Wie krieg ich das hin das wenn ich links drücke er bild 0, bei rechts bild 2 und wenn ich nix drücke er bild 1 darstellt? Ich hab alles mögliche ausprobiert aber...scheine heute echt Hirnleere zu haben Sad
AnimImage besteht also aus 3 bildern.

Code: [AUSKLAPPEN]

Function Display_Player ()
If MilliSecs() > fframe + 10 Then
fframe=MilliSecs()
fframe=(fframe + 1)
fframe=1
End If
If Player_Alive And Game_Playing
DrawImage fighter, Player_PosX , Player_PosY-50,fframe

               If KeyDown ( Key_Up ) Then Player_PosY = Player_PosY - Player_Speed
               If KeyDown ( Key_Down ) Then Player_PosY = Player_PosY + Player_Speed
               If KeyDown ( Key_Left ) Then Player_PosX = Player_PosX - Player_Speed
--- hier müsste doch was hin?1 ---
               If KeyDown ( Key_Right ) Then Player_PosX = Player_PosX + Player_Speed
   
         
End If
End Function


Danke

sector
Projekt : RetroAge Team
 

HOT-BIT

Gast

BeitragSo, März 14, 2004 16:02
Antworten mit Zitat
Hoi,

du mußt bei den Abfragen auch deine Variable >fframe< ändern !

Aber irgendwas stimmt da sowieso nicht, mit dieser Variable !

Schau dir das mal an !


Code: [AUSKLAPPEN]

If MilliSecs() > fframe + 10 Then
fframe=MilliSecs()
fframe=(fframe + 1)
fframe=1
End If


Toni

Rallimen

Sieger des 30-EUR-Wettbewerbs

BeitragSo, März 14, 2004 16:37
Antworten mit Zitat
Benutzer-Profile anzeigen
Hier, so müßte es gehen Code: [AUSKLAPPEN]
Function Display_Player () ; global Frametime,Richtungsframe
If MilliSecs() > Frametime + 10 Then
   Frametime=MilliSecs()

   If Player_Alive And Game_Playing
      DrawImage fighter, Player_PosX , Player_PosY-50,Richtungsframe
      
      If KeyDown ( Key_Up ) Then Player_PosY = Player_PosY - Player_Speed
      If KeyDown ( Key_Down ) Then Player_PosY = Player_PosY + Player_Speed
   
      If KeyDown ( Key_Left ) Then
         Player_PosX = Player_PosX - Player_Speed
         Richtungsframe = 0
         Return
      End If
      
      If KeyDown ( Key_Right ) Then
         Player_PosX = Player_PosX + Player_Speed
         Richtungsframe = 2
         Return
      End If
      Richtungsframe = 1; falls kein left right war dann dieses
   End If
EndIf   
End Function
[BB2D | BB3D | BB+]

Neue Antwort erstellen


Übersicht BlitzBasic Allgemein

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group