本文整理汇总了Python中object.Object.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Object.__init__方法的具体用法?Python Object.__init__怎么用?Python Object.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object.Object
的用法示例。
在下文中一共展示了Object.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import __init__ [as 别名]
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
示例2: __init__
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import __init__ [as 别名]
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')
示例3: __init__
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import __init__ [as 别名]
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.
示例4: __init__
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import __init__ [as 别名]
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.
示例5: __init__
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import __init__ [as 别名]
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)
示例6: __init__
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import __init__ [as 别名]
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()
示例7: __init__
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import __init__ [as 别名]
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
示例8: __init__
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import __init__ [as 别名]
def __init__(self):
threading.Thread.__init__(self)
Object.__init__(self)
# OBJECTS
self.scheduler = Schedule() # The schedule object
self.series = [] # List of series
示例9: __init__
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import __init__ [as 别名]
def __init__(self):
Object.__init__(self)
self.set_property("radius", 10)
control = Control()
self.handler.control.append(control)
示例10: __init__
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import __init__ [as 别名]
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 = ""
示例11: __init__
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import __init__ [as 别名]
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
示例12: __init__
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import __init__ [as 别名]
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
示例13: __init__
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import __init__ [as 别名]
def __init__(self):
"""
@brief Creates an EntryBox
"""
Object.__init__(self)
self._text = ""
self._hidden = False
self._hidden_character = '*'
示例14: __init__
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import __init__ [as 别名]
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
示例15: __init__
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import __init__ [as 别名]
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 = []