O'Reilly logo

Software Engineering and Computer Games by Rudy Rucker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required