add GameStateMachine
fix setXY bug
add mouse handler