-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_examples.py
39 lines (29 loc) · 1.01 KB
/
run_examples.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"""Module to bind and run the different examples"""
# Imports
import pygame
from mvctools.control import BaseControl
from examples.loadingscreen import LoadingState
from examples.menuscreen import MenuState
from examples.board import BoardState
from examples.pausescreen import PauseState
from examples.settingscreen import SettingState
from examples.cputestscreen import CpuTestState
# Create the main control
class Example(BaseControl):
"""Main control for the example"""
ressource_dir = "resource"
window_title = "Example v1.0"
# Set the links between the different states
Example.first_state = LoadingState
LoadingState.next_state = MenuState
MenuState.state_dct["Play"] = BoardState
MenuState.state_dct["Settings"] = SettingState
MenuState.state_dct["CPUTest"] = CpuTestState
MenuState.state_dct["Quit"] = None
BoardState.next_state = MenuState
BoardState.pause_state = PauseState
# Run the example
if __name__ == "__main__":
example = Example()
example.gamedata.board_level = 0
example.run()