Computer games as motivation for design patterns

  • Authors:
  • Paul V. Gestwicki

  • Affiliations:
  • Ball State University, Muncie, IN

  • Venue:
  • Proceedings of the 38th SIGCSE technical symposium on Computer science education
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present a computer game case study that can be used to motivate the need for design patterns. Design patterns are often misunderstood, but good examples can motivate students to work at understanding patterns. Computer games are used in many books and online resources to teach programming concepts, but these examples are usually simplified or non-object-oriented. We present a simple game that exhibits functionality found in commercial games (animation, collision detection, etc.) and show how it can be used as a case study for design patterns. Specifically, we illustrate how the state, facade, observer, strategy, and visitor patterns can replace procedural approaches for implenting the logic and animation of game written in Java.