game — Pyskool 1.1.1 documentation

### Navigation

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

# game

Defines the `Game` class.

class `game.` `Game`(ini_file, images_dir, sounds_dir, scale, ini_dir, quick_start, cheat, 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. scale (number) – The desired scale at which to run the game. ini_dir – The directory to scan for game ini files. quick_start – True to force the game to start quickly, None to use the QuickStart ini file parameter. cheat – True to force cheat keys to be enabled, None to use the Cheat ini file parameter. 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.1 documentation »