Fixed the animation issue and optimize codes.

1. Timer is good thing and it fixed all the animation issues... So
there's animation for the player and ai, and each move is instantly
displayed :)
2. Optimize some codes. (Use switch instead of if)
3. Guess that will be all. OTL......