14.2. The 2D Game Stub

The gamestub.* files are meant to be a possible starting point for your games. Alter the gamestub.* files freely. The basic idea is to have five kinds of critters: the player, the player’s bullets, a rival armed critter, the rival’s bullets, and a prop critter that can act as a kind of food or health-pack for the player. This means that six classes are prototyped in gamestub.h : cGameStub, cCritterStubPlayer, cCritterStubPlayerBullet, cCritterStubRival, cCritterStubRivalBullet, and cCritterStubProp. There’s some more discussion of these classes and a UML diagram (Figure 3.11) of them in the last section of Chapter 3: The Pop Framework.

The cGameStub has an int _rivalcount field in addition to the int _seedcount field it ...

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.