There has been an active movement towards fun learning, using games in education. This article introduces the text-based serious game “Rise of the Java Emperor” that aims to support students in learning basic object-oriented programming concepts using Java. Information concerning the analysis, the design and the pilot evaluation of the game is presented. Thirty-three undergraduate and postgraduate students of an Applied Informatics Department voluntarily played and answered a questionnaire based on the MEEGA+ model, in order to investigate the perceived player experience and short-term learning as well as the acceptance of a text-based programming game by students. The results of the evaluation show that text based games can be both fun and instructional for the field of computer programming. An important issue that requires further research is how this or other programming games can be successfully combined with traditional teaching methods for enhancing the learning of programming.