return 0 if ESC key, return 1 if gameover