iswalking.cpp (730B)
1 // iswalking check 2 3 #include "../lash_game_sprite.h" 4 #include <stdio.h> 5 6 int main() { 7 Lash_Sprite_2D_Simple *s = new Lash_Sprite_2D_Simple(100, 100, 0.f, 0.f); 8 printf("Init iswalking: %d\n", s->isWalking(0)); 9 s->walkRight(); 10 printf("After right iswalking: %d\n", s->isWalking(0)); 11 printf("After right iswalking(right): %d\n", s->isWalking(LASH_GAME_SPRITE_SIMPLE_STATE_RIGHT)); 12 s->walkLeft(); 13 printf("After left iswalking: %d\n", s->isWalking(0)); 14 printf("After left iswalking(right): %d\n", s->isWalking(LASH_GAME_SPRITE_SIMPLE_STATE_RIGHT)); 15 printf("After left iswalking(left): %d\n", s->isWalking(LASH_GAME_SPRITE_SIMPLE_STATE_LEFT)); 16 s->stop(); 17 printf("After stop iswalking: %d\n", s->isWalking(0)); 18 return 0; 19 20 }