Exemple #1
0
    def __init__(self, image, position, size):
        self.display = Display()
        # create surface
        self.image = image

        # get image size and position
        self.rect = pygame.Rect(position, size)
Exemple #2
0
    def __init__(self):
        """
        We build the instance of the class.
        """

        self.display_open_food_fact = Display()

        self.host = Glob.host
        self.user = Glob.user
        self.password = Glob.password
        self.database = Glob.database
        self.db_connect = mysql.connector.connect(host=self.host,
                                                  user=self.user,
                                                  password=self.password)
        self.cursor = self.db_connect.cursor()

        self.category_id = 0

        self.cat_id = 0
        self.food_id = ""
        self.food_name = ""
        self.food_url = ""
        self.food_shop = ""
        self.food_nutrition = ""

        self.substitute_id = 0
        self.substitute_name = ""
        self.substitute_url = ""
        self.substitute_shop = ""
        self.substitute_nutrition = ""
Exemple #3
0
    def __init__(self):
        """
        We build the instance of the class.
        """

        self.database = MySQL()

        self.api_open_food_fact = Api()

        self.display_open_food_fact = Display()
Exemple #4
0
    def __init__(self):
        """
        We build the instance of the class.
        """
        self.database = MySQL()

        self.url = \
            'https://fr.openfoodfacts.org/langue/francais/categories.json'

        self.category_json = json.loads(requests.get(self.url).text)

        self.display_open_food_fact = Display()
Exemple #5
0
def start_scene():
    """
       Runs the start screen 
    """
    from Menus.select_team import SelectTeam  # placing the import in a func makes python import that module only when needed
    from Menus.button import Button
    from Display.display import Display
    select_team = SelectTeam()
    display = Display()
    # start scene audio
    pygame.mixer.music.load('assets/audio/menu/main_menu.wav')
    pygame.mixer.music.set_volume(0.3)
    pygame.mixer.music.play(-1)

    # loading main menu background
    main_menu_img = pygame.image.load(
        "assets/sprites/Backgrounds/main-menu.png").convert()

    # creating start button
    start_btn = Button(
        pygame.image.load("assets/sprites/Buttons/start-game.png").convert(),
        (410, 380), (200, 80))

    while True:
        display.display_background(main_menu_img)
        display.display_text("Soccer Match Simulator 2020", display.font_title,
                             (250, 300))
        start_btn.draw()
        for event in pygame.event.get():
            if event.type == QUIT:
                pygame.quit()
                sys.exit()

            # if start game is clicked move to SelectTeam class
            start_btn.event_handler(event, select_team.select_home)

        pygame.display.update()
Exemple #6
0
 def __init__(self, home_team, away_team):
     self.display = Display()
     self.home_team = home_team
     self.away_team = away_team
Exemple #7
0
 def __init__(self):
     self.display = Display()
     self.select_team = SelectTeam()
     self.match_vars = MatchVariables()
Exemple #8
0
 def __init__(self):
     self.display = Display()
     self.background = pygame.image.load("assets/sprites/Backgrounds/background.png").convert()
Exemple #9
0
 def __init__(self):
     super().__init__()
     self.match_vars = MatchVariables()
     self.display = Display()