state pattern for game state control