This paper proposes a rehabilitative gait training robotic system based on the virtual reality technology, which improves the current tedious and boring patients rehabilitative training process. Virtual game is activated by the information from the brain-computer interface and runs in the form of a thread with a singleton design pattern as the main mode. Interacting with the main software, virtual game can achieve quick and effective access operations of heart rate and other physiological information of patients, which are properly reflected in the game. Virtual game makes rehabilitation training more interesting and attractive and significantly increases patients' initiative to participate in rehabilitation training.