def __init__(self): Object.__init__(self) # VARS self.episode = 0 # The last episode played. self.since = 0 # How many times it's been since this series was last played. self.num = 0 # The amount of items in this series.
def __init__(self, latlng=None): Object.__init__(self) if latlng is None: raise ValueError('Trying to create marker with empty coordinates') self.latlng = latlng self.color = (1, 0, 0) self.size = 10
def __init__(self, x, y, name, oid=None, use_function=None, prev_monster=None): Object.__init__(self, x, y, name, oid=oid) self.blocks_sight = False self.blocks_movement = False # For items which were previously a monster. Used for # resurrection, de-stoning, etc. self.prev_monster = prev_monster if use_function is None: if self.name == 'healing potion': self.use_function = spell.cast_heal elif self.name == 'scroll of fireball': self.use_function = spell.cast_fireball elif self.name == 'scroll of lightning': self.use_function = spell.cast_lightning elif self.name == 'scroll of confusion': self.use_function = spell.cast_confuse else: self.use_function = None else: self.use_function = use_function
def __init__(self, imgLocation, xPos, yPos, width, height): Object.__init__(self, imgLocation, xPos, yPos, width, height) #Modify the rect to include only one of three states self.rect.height = self.rect.height / 3 self.rect.center = (xPos, yPos) self.subrect = pygame.Rect(0, 0, self.rect.width, self.rect.height) self.state = ClickableButton.NORMAL
def __init__(self): Object.__init__(self) self.set_property("radius", 10) control = Control() self.handler.control.append(control)
def __init__(self, player): Object.__init__(self) self.player = player self.animation = animation.Animation('bandage') self.rect = pygame.Rect(player.x, player.y, 0, 0) self.step = 0 self.set_state('starting')
def __init__(self): threading.Thread.__init__(self) Object.__init__(self) # OBJECTS self.scheduler = Schedule() # The schedule object self.series = [] # List of series
def __init__(self): Object.__init__(self) self._name = "unknown" # body self._gender = 0 self._skin_color = 0 self._hair_style = 0 self._hair_color = 0 self._underwear_color = 0 # dress self._mantle = None self._shoes = None self._legging = None self._hauberk = None self._armor = None self._cap = None # weapon self._weapon = None self._shield = None # an action is a tuple representing the action, its direction # and its duration in milliseconds. eg: (SUFFER, NE, 1000) self.pending_actions = [] self.loop_action = (STAND, N, 1000) self.current_action = self.loop_action # this is the current animation self._animation = self.create_animation(self.loop_action) # internal elapsed_time needed to remember the remaining time self.elapsed_time = sf.Time()
def __init__(self, name="unnamed game object", components=[]): Object.__init__(self) self.components = {} self.transform = Transform(self, name) self.components["Transform"] = self.transform for component in components: self.addComponent(component)
def __init__(self, game, name, sprites, x, y, player): Object.__init__(self, game.stage) self.game = game self.name = name self.init_animations() self.image = self.animation.get_image() self.x = x self.y = y self.rect = pygame.Rect(self.x, self.y, 10, 10) self.flip = True self.change_state(Stand(self)) self.dy = 0 self.sprites = sprites self.last_attack = (0, 0) self.player = player self.shadow = shadow.Shadow(self) # Collision when is trowed self.collision_fly = None self.update_animation() if player: self.update() self.energy = energy.EnergyModel(name, 100, game.on_enemy_energy_model_change) else: Object.update(self) self.z = -self.y
def __init__(self): Object.__init__(self) # VARS self.series = [] # List of series to play. self.exclude_series = [] # List of series to exclude. If none, then none will be excluded. self.new_episodes = False # Only play new episodes. self.old_episodes = False # Only play old episodes. self.groups = [] # Only play from these groups self.exclude_groups = [] # Don't play any from these groups. self.use_ads = False # Play ads self.ads = [] # List of ads self.exclude_ads = [] # self.ad_groups = [] # Play only ads from these groups self.ad_exclude_groups = [] # Don't play any ads from these groups. self.picker = settings.PICKER # The picker to use in this block. self.ad_picker = settings.AD_PICKER # Thi picker to use to pick adverts # REALTIME VARS self.current = False # If this block is currently being played.
def __init__(self, engine, position=(0,0,0)): Object.__init__(self, engine, position) self.engine = engine self.x = position[0] self.y = position[1] self.z = position[2] self.faces = []
def __init__(self): threading.Thread.__init__(self) Object.__init__(self) # VARS self.running = False # Whether or not the schedular is running self.blocks = [] # blocks active self.player = settings.PLAYERS[settings.PLAYER]() self.play_advert = False
def __init__(self, text=""): """ @brief constructs a button with a given text. @var text: The label of the Button """ self._text = text Object.__init__(self) self._forecolor = ""
def __init__(self, image, x, y): Object.__init__(self) self.image = image self.x, self.y = x, y self.rect = self.image.get_rect() self.rect.centerx = x self.rect.bottom = y self.dy = 0 self.z = -y
def __init__(self): """ @brief Creates an EntryBox """ Object.__init__(self) self._text = "" self._hidden = False self._hidden_character = '*'
def __init__(self, *args, **keywordArgs): """ The Object class is the base-class for every object in a :class:`network <Network.Network.Network>`. Any number of user-defined attributes or stimuli can be added to an object. The connectivity of objects can also be investigated. """ Object.__init__(self, *args, **keywordArgs) self.stimuli = []
def __init__(self, x, y, datadir): Object.__init__(self) self.x, self.y = rand(x - 20, x + 20), rand(y - 20, y + 20) color = rand(0, 2) self.frame = Frames(datadir, 'hit%d_6.png' %(color)) self.step = -1 self.delay = 0 self.update_animation() self.rect = pygame.Rect(self.x, self.y, 0, 0) self.z = -2000
def __init__(self, x=100, y=400): Object.__init__(self) self.normal = common.load_image("cursor.png") self.invisible = common.load_image("invisible.png") self.set_visible(False) self.x, self.y = x, y self.rect = self.normal.get_rect() self.rect.centerx = x self.rect.bottom = y self.dy = 0 self.z = -y
def __init__(self): Object.__init__(self) self.dash = list() self.radius = 20 control = Control() self.handler.control.append(control) control = Control() self.handler.control.append(control) self.block = False
def __init__(self): Object.__init__(self) self.handler.line = True self.dash = list() self.start = Point() self.end = Point() self.set_property("arrow-tip-length", 4 * 4) self.set_property("arrow-length", 8 * 4) self.set_property("arrow-width", 3 * 4)
def __init__(self, autotick=True): # Call inherited __init__ first. threading.Thread.__init__(self) Object.__init__(self) # Now our vars self.startTimeString = "" # The time when the timer starts as a string self.endTimeString = "" # The time when the timer stops as a string self.timeFormat = "" # The string to use as the format for the string self.set = False # The timer starts deactivated self.process = autotick # Wether or not to run in a seperate process. self.rung = False # Has the timer rang yet?
def __init__(self, rows=5, columns="0", titles=_("Column 1")): Object.__init__(self) self.vertical_spacing = 5 self.horizontal_spacing = 5 self.control = MANUAL self.rows = rows self.columns = columns self.titles = titles self.font = "Verdana" self.size = 16
def __init__(self, x, y, char, name, color, fighter_component, race, job, start_equipment=None): self.level = 1 self.job = job self.race = race self.inventory = [] if start_equipment is not None: self.inventory.append(start_equipment) start_equipment.equipment.is_equipped = True fighter_component.hp += start_equipment.equipment.max_hp_bonus self.job.mp += start_equipment.equipment.max_mp_bonus Object.__init__(self, x, y, char, name, color, blocks=True, fighter=fighter_component, race=race)
def __init__(self): Object.__init__(self) #self.handler.line = True self.dash = list() self.radius = 20 self.control = MANUAL control = Control() self.handler.control.append(control) self.block = False
def __init__(self, x_pos, y_pos): self.width = 5 self.height = 15 self.velocity = [] self.speed = 5 self.thrusters = False self.velocity.append(0) self.velocity.append(0) Object.__init__(self, x_pos, y_pos, self.width, self.height, self.velocity) self.type = "player"
def __init__(self): Object.__init__(self) self.angle_start = 0.0 self.angle_stop = 360.0 self.radius_horizontal = 0 self.radius_vertical = 0 self.centre_x = 0 self.centre_y = 0 self.closed = False self.closed_at_centre = False self.handler.control.append(Control()) self.handler.control.append(Control())
def __init__(self, image, x, y, base_y, dx, flip=False): Object.__init__(self) self.dx = dx self.dy = randint(-7, -4) self.image = image self.rect = image.get_rect() self.rect.x, self.rect.y = x, y self.alpha = 255 self.z = - base_y self.base_y = base_y if flip: self.image = pygame.transform.flip(self.image, True, False)
def __init__(self, pt, eta, phi): """ Constructor """ ## Base class constructor Object.__init__(self, pt, eta, phi) ## Define colors for charged and neutral particles self.color_charged = (0.45, 0.45, 0.00) self.color_neutral = (0.40, 0.45, 0.50) # Generate the decay products self.generate()
def __init__(self,posx=0,posy=0,posz=0,texture=None): Object.__init__(self,posx,posy,posz,texture) self.point=[] # self.VBO=True self.VBO_Buf=None self.size=0 self.type=GL_TRIANGLES self.points.append((0.0,0.0,0.0,0.0,0.0)) self.points.append((1.0,1.0,1.0,0.0,1.0)) self.points.append((0.0,1.0,0.0,0.0,1.0)) self.points.append((0.0,0.0,0.0,0.0,0.0)) self.points.append((1.0,0.0,1.0,0.0,0.0)) self.points.append((1.0,1.0,1.0,0.0,1.0))
def __init__(self, auto=""): # Call inherited __init__'s Object.__init__(self) # Vars self.videos = [] # A list of all the videos in this series. self.extensions = settings.SERIES_AUTOFIND_EXTENSIONS self.path = "" # The path to folder containing the series. self.pickle = SeriesPickle() # The object to save settings to. # Call auto if a path is passed to us. if auto != "": self.auto(auto)
def __init__(self, pos = (0,0), align="grid"): """ @brief Constructs a Layer at specified position. @var position: A tuple of size 2 indicating the (x,y) coordinates of the layer (top left corner) @var align: The alignment type of the object. grid = (row, column), pack = center it! """ Object.__init__(self) self._items = [] self.set_align(align) self.set_position(pos) self._blended_background = False
def __init__(self, mob): Object.__init__(self) self.mob = mob # an action is a tuple representing the action, its direction # and its duration in milliseconds. eg: (SUFFER, NE, 1000) self.pending_actions = [] self.loop_action = (STAND, N, 1000) self.current_action = self.loop_action # this is the current animation self.animation = self.create_animation(self.loop_action) # internal elapsed_time needed to remember the remaining time self.elapsed_time = sf.Time()
def __init__(self, _xPos, _yPos, _identification): Object.__init__(self, _xPos, _yPos, Particle.particle_radius, Particle.particle_radius) self.identifier = _identification self.row = None self.column = None self.x_velocity = 0 self.y_velocity = 0 #Find row in lattice based on identifier _row = self.identifier / 3 #if(_row < 1) : self.row = 0 #elif(_row < 2) : self.row = 1 #else : self.row = 2 self.row = _row - 1 #Find column in lattice based on identifier self.column = self.identifier % 3
def __init__(self, pt, eta, phi, btag=False): """ Constructor """ ## Base class constructor Object.__init__(self, pt, eta, phi) ## Define colors for charged and neutral particles self.color_charged = (0.65, 0.25, 0.0) self.color_neutral = (0.40, 0.45, 0.50) ## Is it a b-tagged jet self.btag = btag ## Generate the particles making the jet self.generate()
def __init__(self): Object.__init__(self) py.sprite.Sprite.__init__(self) self.speed = config.normal_speed self.turn_speed = 3 self.particle_system = particle.ParticleSystem() self.vParticle_system = particle.VelocityParticleSystem() self.imgs = [] self.sonic_imgs = [] self.boom_imgs = [] self.health = config.player_health self.live = True self.turbo = 100 self.emp_affected = False self.releasing_turbo = False self.slowvalue = 1 self.emp_duration = 0 self.fuel = 500 for i in range(6): self.imgs.append( py.image.load("../images/top" + str(i + 1) + ".png")) for i in range(6): self.sonic_imgs.append( py.image.load("../images/sonic/sonic" + str(i + 1) + ".png")) for i in range(8): self.boom_imgs.append( py.image.load("../images/sonic/boom/boom" + str(i + 1) + ".png")) self.damaging = False self.damageshowindex = 0 self.frame = 0 self.sonic_frame = 0 self.width = 80 self.height = 80 self.damage_image = py.image.load("../images/damage.png") self.permimage = self.imgs[self.frame] self.permimage = py.transform.scale(self.permimage, (self.width, self.height)) self.image = py.image.load("../images/ship.png") self.rect = self.permimage.get_rect() self.angle = 0 self.shoottimer = time.time()
def __init__(self, x, y, char, color, name, range, money, hostile=False, items=[], knowledge=[]): Object.__init__(self, x, y, char, color) self.name = name self.range = range self.money = money self.hostile = hostile self.items = items # dictionray of items and what they are willing to trade for self.knowledge = knowledge # dictionary of knowledge tidbits according to menu """
def __init__(self, text = _("enter text here")): Object.__init__(self) self.layout = None class Cursor: pass self.cursor = Cursor() self.cursor.visible = True self.cursor.index = (0, 0) self.timer_id = gobject.timeout_add(500, self.timer) self.font = "Verdana" self.size = 32 self.preserve = False self.text = text self.foreground = "#000" # TODO
def __init__(self, parent, content, screen): Object.__init__(self, parent, content, screen) self.x = 2 self.y = 2 self.speed = 5 self.moveUp = False self.moveDown = False self.moveLeft = False self.moveRight = False self.controlComponent = ControlComponent() self.moveComponent = MoveComponent(self, screen) self.collisionComponent = CollisionComponent(self) self.tailComponent = TailComponent() self.components.append(self.controlComponent) self.components.append(self.moveComponent) self.components.append(self.collisionComponent) self.components.append(self.tailComponent) self.tailComponent.addNode(self)
def __init__(self, pt, eta, phi): """ Constructor """ ## Base class constructor Object.__init__(self, pt, eta, phi) ## Photon is white/blueish self.color = (0.40, 0.45, 0.50) ## Photon is a single particle self.particles = [ Particle(self.pt, self.eta, self.phi, self.color, isEM=True, isHAD=False) ]
def __init__(self, pt, eta, phi): """ Constructor """ ## Base class constructor Object.__init__(self, pt, eta, phi) ## Electron is blue self.color = (0.1, 0.1, 1.0) ## Electron is a single particle self.particles = [ Particle(self.pt, self.eta, self.phi, self.color, isEM=True, isHAD=False) ]
def __init__(self, x_pos, y_pos, size): if (size == 1): self.width = 75 self.height = 75 elif (size == 2): self.width = 50 self.height = 50 else: self.width = 25 self.height = 25 self.velocity = [] self.velocity.append(random.randint(-10, 11)) self.velocity.append(random.randint(-10, 11)) # self.velocity.append(0) # self.velocity.append(0) self.x_pos = x_pos self.y_pos = y_pos Object.__init__(self, self.x_pos, self.y_pos, self.width, self.height, self.velocity) self.type = "metor"
def __init__(self, pt, eta, phi): """ Constructor """ ## Base class constructor Object.__init__(self, pt, eta, phi) ## Muon is crimson self.color = (0.6, 0.0, 0.2) ## Electron is a single minimum ionizing particle ## (makes it through the calorimeter) self.particles = [ Particle(self.pt, self.eta, self.phi, self.color, isEM=False, isHAD=False, is_min_ion=True) ]
def __init__(self, pt, phi): """ Constructor """ ## Base class constructor Object.__init__(self, pt, 0.0, phi) ## Brightness of the MET beam goes with MET magnitude intensity = 0.01 * math.log(self.pt / 1000.0 + 1.0) ## MET is green self.color = (0.0, intensity, 0.0) ## MET is made of the one beam self.particles.append( Particle(self.pt, 0.0, self.phi, self.color, isEM=False, isHAD=False, is_min_ion=False, wide=True))
def __init__(self, x, y, name, oid=None, ai=None, hp=None, max_hp=None, mp=None, max_mp=None, death=None, fov_radius=cfg.TORCH_RADIUS, inventory=None): Object.__init__(self, x, y, name, oid=oid) self.ai = ai # Let the AI component know who its owner is if self.ai is not None: self.ai.owner = self self.blocks_sight = False self.blocks_movement = True self.fov_radius = fov_radius # Function to call when this monster dies self.death = None # Field of view map. self.fov_map = None # FIXME: this should be loaded from a database if name == 'wizard': if hp is None: self.hp = 30 if death is None: self.death = None self.atk_power = 5 self.defense = 2 elif name == 'orc': if hp is None: self.hp = 1 if death is None: self.death = die_leave_corpse self.atk_power = 1 self.defense = 0 elif name == 'troll': if hp is None: self.hp = 10 if death is None: self.death = die_leave_corpse self.atk_power = 2 self.defense = 0 if hp is not None: self.hp = hp if death is not None: self.death = death if max_hp is None: self.max_hp = self.hp else: self.max_hp = max_hp if inventory is None: self.inventory = [] else: self.inventory = inventory # FIXME dummy values self.mp = 13 self.max_mp = 25 self.xp = 1220 self.xp_next_level = 2000 self.weight = 580 self.burdened = 1000 self.hunger = 450 self.max_hunger = 1000
def __init__(self, x_pos, y_pos, velocity): self.size = 5 Object.__init__(self, x_pos, y_pos, self.size, self.size, velocity) self.type = "bullet" self.life_span = 25
def __init__(self, radius, density, position): Object.__init__(self, radius, density, position, colour=(255, 0, 0))
def __init__(self, name, *args, **kwargs): Object.__init__(self, *args, **kwargs) self.name = name self._task = None
def __init__(self, game_object): Object.__init__(self) # add the component to the game object's components dict assert not game_object.components.has_key(type(self).__name__) game_object.components[type(self).__name__] = self self.game_object = game_object
def __init__(self, parent, content, screen): Object.__init__(self, parent, content, screen)
def __init__(self, radius, density, position): Object.__init__(self, radius, density, position)
def __init__(self, code="800894002700", barcode_type=DEFAULT_CODE_TYPE): Object.__init__(self) self.code = code self.type = barcode_type
def __init__(self, image=os.path.join("images", "logo.png")): Object.__init__(self) self.image = image