def start(): # При старте игры global cursor pygame.mouse.set_visible(False) # Скрыть курсор Background(general.load_image('background.jpg'), Transform((0, 0))) # Фон Background(general.load_image('background2.png'), Transform((-100, 400)), 0.1) general.load_map() # Загрузка карты player = Pers(Transform((200, 600))) # Игрок general.player = player general.camera = Camera(Transform((0, 0), parent=player.transform_), offset=(-900, -540)) # Камера player.select_weapon(Weapon('pistol', player.transform_)) # Выбор оружия # Разбросанные по карте оружия Weapon('ak_47', pos=(2300, 950)) Weapon('shotgun', pos=(2450, 950)) Weapon('rifle', pos=(2600, 950)) Weapon('machine gun', pos=(14800, 1650)) Weapon('p90', pos=(15000, 1650)) Weapon('sniper', pos=(15200, 1650)) cursor = Background(load_image('cursor.png'), Transform( (100, 100))) # курсор мыши
def __init__(self): Weapon.__init__(self) self.damage = '1d1' self.name = 'Hands' self.value = 0
def __init__(self): Weapon.__init__(self) self.damage = '6d12' self.name = 'Light Saber' self.value = 100
def __init__(self): Weapon.__init__(self) self.damage = '2d3' self.name = 'Dirk' self.value = 50
def __init__(self): Weapon.__init__(self) self.damage = '1d4' self.name = 'Dagger' self.value = 10
from characters import Weapon, Combantant import characters from random import randint from sys import exit #environment Variables: gladiator = Combantant() gladiator.health= 100 glad2 = Combantant() glad2.health = 100 rifle = Weapon() rifle.DMG = randint(15,17) machete = Weapon() machete.DMG = randint(8,20) class Engine(object): def __init__(self,scene_map): self.scene_map = scene_map def play(self): current_scene = self.scene_map.opening_scene() last_scene = self.scene_map.next_scene('finished') while current_scene != last_scene: next_scene_name = current_scene.enter()