You call walk(self, dt) first. And if you look at the end of your walk() function you set direction to 0:
self.direction = vmath.vector3(0, 0, 0)
``
Both animate() and flip() use self.direction to determine which animation to play and if the sprite should flip. Change the order of function calls and call walk() last!