It is a key problem in the robot soccer game that is the global path planning and obstacle-avoidance of the soccer robots. The path planning is always gotten into the local minimum value solved by the traditional artificial potential field (APF). However, it can be improved by genetic algorithm (GA). In this paper, a novel algorithm (APFGA) combining APF with GA is put forward for the path planning and obstacle-avoidance. First, the algorithm confirms the effective area of obstacle-avoidance and the manner of path generation based on APF, and then it adopts the compact fitness function and designs the genetic operators in detail. Furthermore, the author uses the least square method for curve fitting. In the end, the simulation results indicate that the soccer robot can avoid the obstacles and explore the optimal path by the algorithm presented in this paper