Animation 2

Blitz3D Forums/Blitz3D Beginners Area/Animation 2

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

As Semar said, your frmman variable only cycles through the values 0 to 3. Try this:

Global man, frmman=0, tmrman, dir=0

Graphics 800,600

SetBuffer BackBuffer()

man=LoadAnimImage("walkingman.jpg",40,40,0,8)

MaskImage man,255,255,255

manx=0
many=280
mansp=2

While Not KeyHit(1)

Color 255,255,255
Rect 0,0,800,600,1

If KeyDown(205) Then
	
	dir=0

	timing_man()
	
	manx = manx + mansp
	
EndIf 

If KeyDown(203) Then
	
	dir=4

	timing_man()
	
	manx = manx + -mansp
	
EndIf
 
DrawImage man,manx,many,frmman

Flip
Cls

Wend

End

;FUNCTIONS;;;;;;

Function timing_man()

If MilliSecs() > tmrman + 100 Then
	
		tmrman=MilliSecs()
		frmman=((frmman + 1) Mod 4) + dir
		
End If

End Function



Think your left anim images need fixing because he seems to jerk forward when walking left. ;)