finished game loop, end condition
added flag and unflag to Space