Menu Close

Project Overview

This is a game implementation that runs entirely inside of AutoCAD; it uses the C#.NET AutoCAD API. The game uses all of the standard elements that would be available as a drafter. The character sprites are made up of blocks. The maze is built of polylines. All of these items are generated at run time and are not imported from a library.

There are five mazes. The original Pac-Man maze and the four MS. Pac-Man mazes. Each maze is generated from a simple grid. Each corner is made up of a collection of lines and arcs and is arranged in a grid pattern. These separate elements are then combined into a single polyline and assigned a color.

The chomping monster, ghosts, and dots are built from scratch by code. They are combined into a single block for each version of the character. For example, the Ghosts: looking up, looking right, being eaten, and changing color when afraid. Chomp has three mouth states: mid, open, and closed. The block is rotated around its axis to show the direction.

This project started by trying to answer a few simple questions

  • Can we display real-time graphics?
  • Can the graphics update without user interaction?
  • Can we get enough performance to play a game?

Typically, the graphics area will only update under the following conditions.

  • The user moves the mouse on the screen
  • The view is zoomed or panned
  • The user manually regenerates the screen

This can be worked around by using the idle process

  • AutoCAD exposes an idle process approximately every 6 milliseconds.
  • While these values can change depending on what AutoCAD is doing, we can count the intervals.
  • During this interval, we can update the graphics display without flicker or user interaction