In recent years, digital game-based learning has made a splash in the field of education and has had a wide range of impacts. However, most studies have found that the learning achievement and motivation can be improved when games are combined with some learning strategies or instructional support. The decision tree in machine learning technology can quickly categorize and organize data and make analysis and prediction. Therefore, this study designs an educational game that integrates machine learning technology to provide appropriate learning assistance to students with learning difficulties during the game by using the machine learning motion detection function. The experimental group was conducted in a digital game learning mode with machine learning technology, while the control group was conducted in a general digital game learning mode. The results showed that the learners in the digital game learning mode with machine learning technology were significantly better than the learners in the general digital game learning mode in terms of learning achievement. In addition, the combination of machine learning technology in digital games can effectively enhance learners’ learning attitude and self-efficacy, and help learners do well in learning.