Posted by: | 24th Feb, 2012

T-GEM and Pacman

We are using Gamemaker to introduce students to programming because a beginner programmer can create sophisticated and visually pleasing programs without having to learn a formal programming language. Intermediate or advanced students choosing to stay with Gamemaker are required to learn Gamemaker’s programming language, which is a specialized subset of C++. Students program by creating objects, placing the objects in rooms and then creating actions to deal with events (such as pressing a key, a timer expiring, or a collision between objects.) There are numerous possible events and dozens of premade actions, and students can create sequences of actions to create sophisticated outcomes. For example when 2 objects collide (a possible event) they can change the graphics to reflect damaged objects, they can play sounds, they can have one object bounce off the other object or they can display a different window, or all of the above.

I have found conceptualizing and implementing the movement of a non-player character around a maze to be a challenge for my beginner programmers. The second project I have them complete is to make their own PacMan game. Without fail, there are many questions about how to move ghosts around a maze, probably because the students have not put any in depth thought about the problem, and it is non-trivial.

The T-GEM method (Khan, 2007) be applied to this problem as follows:

Background information: Students have been exposed to collisions and moving a non-player character (NPC) in a simplistic fashion (back and forth) in a maze.

Generate: Students are asked to think about and then develop a solution to moving a NPC so it will go around a corner at the end of a path instead of just back and forth (on paper).

Evaluate: Students implement their solution on the computer and test and refine it on a given path.

Modify: Students are asked about turning to go through a doorway partway down a path instead of always going to the end. Students share their solutions with each other and modify as needed.

This is cyclic; initially the path needs to be very simple but in the end needs complexity, which would require additional cycles. As well changes to NPC behavior may be implemented if the player’s object is close by, also adding more cycles. By the end of the cycles, students should be knowledgeable about the logical steps needed to solve the problem of moving ghosts around their own mazes.

References

Khan, S. (2007). Model-based inquiries in chemistry. Science Education, 91(6), 877-905.

Leave a response

Your response:

Categories

Spam prevention powered by Akismet