We used a model viewer controller structure to control the game, and inherited from several pygame classes to streamline graphics and click detection. We created classes for items, backgrounds, text displays and rooms, as well as having an inventory class, and the game model class.
The player is able to interact with the model using the mouse by clicking various aspects of the image. Some of the aspects are items that the player can add to their inventory to unlock future scenes, while other objects, such as displays, buttons, and screens, will trigger story elements. These belong to the Item class, which inherits from pygame Sprite class. Instances of the item class are blitted onto the surfaces of background items, which contains an image, and serves as the scene for an instance of a room class. The room class inherits from pygame sprite groups, and keeps track of items and backgrounds. The space game model class contains and keeps track of the game, and the state of the game. The game model contains instances of the textbox class, the room class, and an instance of the inventory class, which holds all the items the player has collected. The window viewer displays the state of the game and renders it for the player. The mouse controller interprets input from the computer mouse and modifies the model when updates are needed.