use thread for ai
use wait() and notify() for AI thread