-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLauncher.py
More file actions
37 lines (31 loc) · 1.46 KB
/
Copy pathLauncher.py
File metadata and controls
37 lines (31 loc) · 1.46 KB
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
#!/usr/bin/env python
# coding=utf-8
import os
import pygame
from pygame import *
from Intro import Intro
from Game import Game
class Launcher(object):
__window_width = 800 # Ширина окна
__window_height = 640 # Высота окна
__window_icon = image.load_extended("textures/items/bone.png") # Иконка
def main_start(self):
os.environ['SDL_VIDEO_CENTERED'] = '1' # Центрирование окна при запуске
pygame.init() # Инициализация py game
screen = pygame.display.set_mode((self.__window_width, self.__window_height)) # Создание окна
pygame.display.set_icon(self.__window_icon)
pygame.display.set_caption("Skeleton Escape Beta 0.3") # Заголовок окна
bg = Surface((self.__window_width, self.__window_height)) # Создание видимой поверхности фона
exit_flag = False
game_intro = Intro()
game_start = Game()
# Основные функции игры
while not exit_flag:
if game_intro.start_intro(screen, bg): # Сначала показываем меню
exit_flag = True
else:
game_start.start_game(screen, bg, self.__window_width, self.__window_height) # Запуск игры
# Создаем и запускаем новую игру
if __name__ == "__main__":
game = Launcher()
game.main_start()