The purpose of this study was to establish a complete dynamic analysis method for motorcycle engines to serve as course material for study of machine dynamics. Virtual engine software was also developed for users to understand how engine performance is influenced by parameters such as engine accelerator, engine weight, and flywheel. First we applied the vector-loop approach to deduce the kinematic analysis of engine mechanism. We then applied Newton’s method to analyze the bearing force and friction of each link. Next, we used a power equation to deduce the equation of motion of the system, and used the Runge-Kutta method to perform normal dynamic analysis. Finally, by combining computer programs with the Open Graphics Library (OpenGL), we developed virtual engine software for users to observe motion and performance of engine. The results of this study provide engineers a computer-aided design program for automatic generation of all optimal pipes. It is beneficial to pipe design ability.