main game processing