walk animation

Blitz3D Forums/Blitz3D Beginners Area/walk animation

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.

From the Castel demo...

	
If KeyDown(203)	;left/right
		TurnEntity p\entity,0,6,0	;turn player left/right
	Else If KeyDown(205)
		TurnEntity p\entity,0,-6,0
	EndIf
	
	If KeyDown(30)		;forward
		If p\anim_speed<=0
			p\anim_speed=1.75
			Animate p\model,1,p\anim_speed
		EndIf
		MoveEntity p\entity,0,0,1
	Else If KeyDown(44)	;back
		If p\anim_speed>=0
			p\anim_speed=-1.75
			Animate p\model,1,p\anim_speed
		EndIf
		MoveEntity p\entity,0,0,-1
	Else If p\anim_speed	;stop animating
		p\anim_speed=0
		Animate p\model,0
	EndIf