10.3. The virtual methods of cGame

Most of the coding you do involving the cGame class is going to involve extending the cGame constructor and overriding a few special methods called seedCritters, initializeView, adjustGameParameters, and statusMessage.

Here are the main things determined by these methods.

cGame::cGame

  • The size of the game world.

  • What colors to use for the edges and background of the world.

  • What bitmaps, if any, to use for your backgrounds.

  • Whether the world is wrapped or has edges.

  • What class of player critter you’ll use.

  • What ‘permanent’ critters you’ll use.

cGame::seedCritters

  • What ‘temporary’ critters you have.

  • Arrangement of the critters in the world.

cGame::initializeView

  • The background image, if any, to use.

  • The cursor tool ...

Get Software Engineering and Computer Games now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.