animation controls

Blitz3D Forums/Blitz3D Programming/animation controls

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.

It seems to be a problem with the way you handle the idle flag. Well, I didn't read your code carefully, I suggest right away: restart from scratch :) concerning the keys handler. Here's what I'd do:


idle=1

if keydown(walk)
 if jumping=0
  if walking=0
   walking =1
   animate joe,walk_seq
  endif
  idle=0
  swimming=0
  whatever=0
  isbored=0
 endif
 moveentity joe,0,0,1
endif

if keyhit(jump)
 if jumping=0
  jumping =1
  animate joe,jump_seq
  jump_force#=1.1
  isbored=0
  idle=0
  swimming=0
  whatever=0
  walking=0
 endif
endif

if jumping=1
 jump_force=jump_force- .1
 if jump_force < -1.1 then jumping=0 ; add collision check!
endif

if idle=1
 if isbored=0
  animate joe,idle_seq
  isbored=1
 endif
endif

translateentity joe,0,gravity#+jump_force#,0 ; gravity



Well, basicly do the following:
set idle to true
check all possible keys - and set idle to false if the user makes any action
in the end ask if idle is still true and play the idle animation if required.