def process_file(self, filename):
     try:
         self.load_file(ccResourcePaths.get_keys() + filename)
     except:
         ccLogger.error('{} could not be loaded.'.format(filename))
         raise RuntimeError('{} could not be loaded.'.format(filename))
     self.__process_keys()
Ejemplo n.º 2
0
 def process_file(self, filename):
     try:
         self.load_file(filename)
     except:
         ccLogger.error('{} could not be loaded.'.format(filename))
         raise RuntimeError('{} could not be loaded.'.format(filename))
     self.__process_config()
     self.__process_object_sections()
Ejemplo n.º 3
0
 def set_anim(self, anim_name):
     if anim_name in self.anims:
         self.current_anim = ccSpriteManager.get_sprite(anim_name)
         self.current_anim_name = anim_name
         self.current_frame = self.current_anim.get_frame(0)
         self.active_sprite = self.current_frame.get_sprite()
         self.set_hitbox()
     else:
         ccLogger.error("Error: the following animation was not found: ", anim_name)
Ejemplo n.º 4
0
 def package_check():
     cache = apt.Cache()
     if cache['pylint'].is_installed and cache['graphviz'].is_installed:
         ccLogger.trace('Packages for UML creation are installed. Creating UML images.')
         return True
     else:
         ccLogger.error('Required packages not installed. Please execute the following: '
                        'sudo apt-get install pylint, sudo apt-get install graphviz')
         return False
Ejemplo n.º 5
0
    def load(self, anim_data):
        try:
            super().load(anim_data)
            if 'animations' in anim_data:
                temp = anim_data['animations']
                for anim_name in anim_data['animations']:
                    anim = ccSpriteManager.get_sprite(anim_name)
                    self.anims[anim_name] = anim
            if 'start_anim' in anim_data:
                self.set_anim(anim_data['start_anim'])

        except:
            ccLogger.error('Sprite could not be loaded.: ')
            raise RuntimeError('Sprite could not be loaded.')
Ejemplo n.º 6
0
 def step(self, time_passed):
     time = time_passed
     ccLogger.error("Error: step does not work at the moment.")
     error_message = ccLogger("Error: step does not work at the moment.")
Ejemplo n.º 7
0
 def draw(self):
     ccLogger.error("Error: could not draw scene.")
     error_message = ccLogger("Error: could not draw scene.")
Ejemplo n.º 8
0
 def load(self, filename):
     ccLogger.error("Error: file not loaded.")
     error_message = ccLogger("Error: file not loaded.")
Ejemplo n.º 9
0
 def get_texture(self):
     if self.image is None:
         ccLogger.error("Error: there is no image stored.")
     return self.image
Ejemplo n.º 10
0
 def get_height(self):
     if self.height == 0:
         ccLogger.error("Error: height is zero.")
     return self.height
Ejemplo n.º 11
0
 def get_width(self):
     if self.width == 0:
         ccLogger.error("Error: width is zero.")
     return self.width
Ejemplo n.º 12
0
 def get_sprite(cls, sprite_name):
     sprite = cls.sprites.get(sprite_name)
     if sprite:
         return sprite
     ccLogger.error(sprite_name + " not found.")
Ejemplo n.º 13
0
 def get_texture(cls, texture_name):
     texture = cls.textures.get(texture_name)
     if texture:
         return texture
     ccLogger.error(texture_name + " not found.")
Ejemplo n.º 14
0
 def draw(self, renderer):
     ccLogger.error(
         "ccObject is an abstract class, yon can't call the draw function!")
     raise NotImplementedError
Ejemplo n.º 15
0
 def __init__(self):
     ccLogger.error("ccResourcePath is an abstract class, can't call __init__!")
     raise NotImplementedError