game start end logic