### Navigation

- index
- modules |
- next |
- previous |
- Pyskool 1.1.2 documentation »

# game

Defines the `Game` class.

class `game.``Game`(ini_file, images_dir, sounds_dir, ini_dir, options, version, sav_file)

  Builds the skool and the cast, and executes the main loop of the game.

  Parameters: | ini_file – The main Pyskool ini file. images_dir – The path to the images directory. sounds_dir – The path to the sounds directory. ini_dir – The directory to scan for game ini files. options – Options passed from the command line. version (string) – The version number of Pyskool. sav_file – A file from which to restore a saved game.

  `play`()

    Start the game and enter the main loop.

class `game.``Menu`(screen, config, items)

  The in-game menu.

  Parameters: | screen (`Screen`) – The screen (to draw the menu on). config (dict) – Configuration parameters. items – The menu items ((operation, label) tuples).

  `build_images`(screen)

    Build the title image and menu item images.

  `get_operation`(keyboard)

    Return the operation to perform (which may be None).

  `reset`()

    Reset the menu. Specifically:

    - set the selected index to 0
    - clear the status text
    - clear the backdrop on which the menu is drawn

`game.``LOAD` = 'LOAD'

  Menu operation: Load.

`game.``QUIT` = 'QUIT'

  Menu operation: Quit.

`game.``RESUME` = 'RESUME'

  Menu operation: Resume.

`game.``SAVE` = 'SAVE'

  Menu operation: Save.

`game.``SCALE_DOWN` = 'SCALE_DOWN'

  Menu operation: Decrease scale.

`game.``SCALE_UP` = 'SCALE_UP'

  Menu operation: Increase scale.

`game.``TOGGLE_FULLSCREEN` = 'TOGGLE_FULLSCREEN'

  Menu operation: Toggle fullscreen mode.

`game.``UPDATE` = 'UPDATE'

  Menu operation: Update the screen.

### Navigation

- index
- modules |
- next |
- previous |
- Pyskool 1.1.2 documentation »