Just some hints:
- First look at limited your FPS to something like 90. This probably isn't the issue but there is no reason why you should be running at 170+ FPS.
- Second use ent_animate() instead of setting the frame directly. This makes your life easier.

Neither of these will solve your problem however, but (looking at the fact that the debug panels shows you having over 23,000 functions running) I'm going to guess that you call your animate_walk() function more than once for each entity (maybe inside a loop?).

Since your animate_walk() function has an an enless loop it never exits. It runs once each frame. When you call it again, you are creating another animate_walk() loop that does the same thing. Since they are updating the same value (frame), that value will increase twice as fast.

This can quickly add up (frame 1 = 0.7, frame 2 = 1.4, frame 10 = 7). After one second at 171 FPS you will be increasing by 119.7 units every frame!

Make sure you call animate_walk() only once per entity -or- remove the while(1) loop.


Conitec's Free Resources:
User Magazine || Docs and Tutorials || WIKI