Graphics3D 640,480,16,2


poli=LoadAnimMesh( "poli.b3d" )
ScaleEntity poli,0.4,0.4,0.4
RotateEntity poli,0,180,0
MoveEntity poli, 0,0,-50

camara=CreateCamera(poli)
PositionEntity camara,0,100,150
TurnEntity camara,10,180,0

light=CreateLight()

piso=LoadMesh( "ruin.b3d" )

ExtractAnimSeq( poli,1,6 ) ;anim sequence 1: frames 0...6 are 'run' 
ExtractAnimSeq( poli,8,30 ) ;anim sequence 2: frames8...30 are 'jump' etc etc... 

Animate poli,2,0.1,1


While Not KeyHit(1)
semueve#=0



  If KeyDown(200) Then
    If AnimSeq(poli)=1 Then
             Animate poli,1,0.5,2
    EndIf
    semueve#=-0.5
  Else
    If AnimSeq(poli)=2 Then
             Animate poli,2,0.5,1
    EndIf
  EndIf


  If KeyDown(203) Then
       TurnEntity poli,0,1,0
  EndIf


  If KeyDown(205) Then
       TurnEntity poli,0,-1,0
  EndIf

  MoveEntity poli,0,0,semueve#  

  UpdateWorld
  RenderWorld
  Flip

Wend