Predefined Animation While Controlling IMGMovement

Blitz3D Forums/Blitz3D Beginners Area/Predefined Animation While Controlling IMGMovement

A good way to manage this kind of approach would be


Function MonsterMove()
  If Mdir=0 then
    if Monsterx=>1 then 
          Monsterx=Monsterx-1
    elseif Monsterx=0 then
          Monsterx=Monsterx+1
          Mdir=1
          Return
    endif
  esleif Mdir=1 then
    if Monsterx=<760 then 
          Monsterx=Monsterx+1
    elseif Monsterx=760 then
          Monsterx=Monsterx-1
          Mdir=0
          Return
    endif
  endif
End Function


[EDIT]

this will cause the monster to move left to right