Use serialize function for game saving