Well, I'm trying to create somekind of Algorithms for my character however as you can see below
ini_Samus(StandL)
it doesn't draw the right frame it draws the StandR frame not frame 22, see anything wrong?
Full Code Below
ini_Samus(StandL)
it doesn't draw the right frame it draws the StandR frame not frame 22, see anything wrong?
Full Code Below
Graphics 640,480,16,2 ; GLOBAL VAR Global Draw_Samus = 1 Global quit = False Global Frames Global TheTimer Global AnimDelay ; IMAGES Global SamusSprites=LoadAnimImage("images\MR_Samus.png",56,56,0,55) MaskImage SamusSprites,255,255,255 ; SET BUFFER SetBuffer BackBuffer() Frames = 12 AnimDelay = 100 ;----------------------------------------- ; MAIN LOOP While Not KeyDown(1) Or quit = True ; Samus SYS If Draw_Samus = 1 Then ini_Samus(StandL) EndIf Flip:Cls Wend End ;----------------------------------------- ; TYPES Type Player Field Name$ Field HealthBanks% Field Healt% Field x%,y% Field jump% Field gravity% End Type Type Weapon Field Name$ Field MinDam% Field MaxDam% Field Info$ End Type ;----------------------------------------- ; FUNCTIONS Function ini_Samus(Dir$) ;----------------------- Select Dir$ Case StandR ; Stand Right Frames = 11 DrawImage SamusSprites,sX,sY,Frames Case StandL ; Stand Left Frames = 22 DrawImage SamusSprites,sX,sY,Frames Case RWalk ; Walking Right without Gun Point If Frames = 22 Then Frames = 12 DrawImage SamusSprites,sX,sY,Frames sX = sX + 1 If TheTimer+AnimDelay < MilliSecs() Then TheTimer = MilliSecs() Frames = Frames + 1 End If Case LWalk ; Walking Left without Gun Point Default Notify "Theres an error in the Player Routines." : End End Select ;---------------------- End Function