Using a Didactic Game Engine to Teach Computer Science Ricardo Nakamura João L. Bernardes Jr. Romero Tori {ricardo.nakamura, joao.bernardes, romero.tori}@poli.usp.br INTERLAB – Interactive Technologies Laboratory Departamento de Engenharia de Computação e Sistemas Digitais Escola Politécnica da Universidade de São Paulo Av. Prof. Luciano Gualberto, travessa 3 no. 158 - CEP 05508-970 - São Paulo, SP 1. Introduction This tutorial presents enJine, an open-source didactic game engine developed in Java, and discusses how to use it to aid in teaching game development and computer science or engineering topics, especially Computer Graphics. EnJine is developed at the Interactive Technologies Laboratory (Interlab) at University of São Paulo and is available as free software under the GPL License. It uses the Java 3D API and shares the multiplatform and object-oriented characteristics of the Java language. In its first version, this game engine was not a didactic tool in itself, but rather a tool for the creation of didactic games. All three of this tutorial's authors, however, have been involved for at least a few (and in one case quite a few) years in teaching courses in computer science and computer engineering programs and have experimented successfully with the use of game programming in this activity. The realization that enJine had a good potential as a didactic tool in itself was one of the main points behind the creation and release of a new version of it and has so far proven correct. The following section describes enJine in detail, including a brief introduction to Java 3D, and a discussion of its architecture. Section 3 focuses in enJine's didactic use, exploring its potential for several courses, and sharing the authors' concrete experience in using it in Computer Graphics courses, providing useful tips and recommendations for educators interested in using the enJine in a similar fashion. Section 4 presents an example of how to create a relatively simple 3D game using it. While this document focuses on the objective aspects of using enJine to serve as a reference and so dedicates more space to its general use than to its use in education, the actual tutorial will, after providing some basic knowledge of enJine, focus on the educational aspects in a more subjective way, discussing the authors' experiences and inviting a more active participation of the audience. 2. EnJine As was just discussed, enJine is set of software components built over Java and Java 3D to provide services and a structure to the creation of games. The main features it offers are: - A set of Java classes to allow flexible representation of game elements such as characters, objects and scenarios; - Basic infrastructure for a game application, including the capability for complex interactions between game objects through a message exchange mechanism; - 3D graphics rendering through the Java 3D API, so that students can have contact with Java 3D and especially the scene graph; - Support for basic sound output and user input (currently only through keyboard, but easily extensible to other devices due to enJine's abstract input layer). Other services, such as skin-and-bones animation (which will not be explored in this tutorial), multistage collision detection functionality or model loaders are also present in enJine's current version, and many other features are also planned for future versions. Among those currently being implemented is network support, for instance.