Procedural Programming is one of many important materials for students of Computer Science and related majors, yet the learning suffers from lots of distractions when implemented by online means. The distractions impact the learning, such as lower motivation and achievement of the students. To improve online learning of the material, Octalysis gamification framework is proposed to improve the motivation and achievement of students while doing online learning of Procedural Programming. The framework puts certain gamification elements in the implementation through the presence of core drives in accordance to the online learning currently used. This research includes experiment to see the significance rate of proposed learning process, which is helped with ANCOVA analysis. The result shows that using gamification framework as learning companion can improve student motivation and achievement, and there is relationship between the motivation and achievement of students after the learning process.