def __init__(self, *args, **kwargs): super(Player, self).__init__(img=resources.player_image, *args, **kwargs) self.keys = [] self.box = pyglet.sprite.Sprite(img=resources.opening_image, *args, **kwargs) self.hp = 100 self.x = resources.window_dimensions[0] * 4 / 5 self.y = resources.window_dimensions[1] / 4 self.default_x = self.x self.default_y = self.y self.keyboard = key.KeyStateHandler() self.box.visible = False self.box.scale = resources.window_dimensions[0] / 10 / self.box.width self.scale = resources.window_dimensions[0] / 10 / self.width self.label = classes.Text(*args, **kwargs) self.score = classes.Text(*args, **kwargs) self.score_value = 0
def __init__(self, *args, **kwargs): self.level_objects = [] super(FinalScreen, self).__init__(img=resources.opening_image, group=resources.background_level, *args, **kwargs) Level_Handler.__init__(self) self.scale = resources.window_dimensions[0] / self.width self.x = resources.window_dimensions[0] / 2 self.y = resources.window_dimensions[1] / 2 self.label = classes.Text(group=resources.text_level)
def __init__(self, *args, **kwargs): super(Goblin, self).__init__(img=resources.goblin_image, *args, **kwargs) self.items = [] self.hp = 1 self.box = pyglet.sprite.Sprite(img=resources.opening_image, *args, **kwargs) self.x = resources.window_dimensions[0] / 5 self.y = resources.window_dimensions[1] / 5 self.box.scale = resources.window_dimensions[0] * 2 / 20 / self.box.width self.scale = resources.window_dimensions[0] * 2 / 10 / self.width classes.flags["Goblin_has_appeared"] = False classes.flags["Goblin_dead"] = False self.label = classes.Text(*args, **kwargs) self.box.visible = False self.visible = False self.total_time = 0