本文整理汇总了Python中object.Object.update方法的典型用法代码示例。如果您正苦于以下问题:Python Object.update方法的具体用法?Python Object.update怎么用?Python Object.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object.Object
的用法示例。
在下文中一共展示了Object.update方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import update [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: update
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import update [as 别名]
def update(self, _state, _system_position, _system_radius):
Object.update(self)
if(_state == 'solid') :
self.solid_update(_system_position)
elif(_state == 'liquid') :
self.liquid_update(_system_position, _system_radius) #TODO: Change from solid_update
#self.solid_update(_system_position)
else :
#self.solid_update(_system_position) #TODO: Change from solid)update
self.gas_update(_system_position, _system_radius)
self.x_position = int(self.x_position)
#print(self.x_position)
self.y_position = int(self.y_position)
示例3: update
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import update [as 别名]
def update(self):
self.control.update()
self.state.update()
Object.update(self)
self.z = -self.y
示例4: update
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import update [as 别名]
def update(self):
self.state.update()
Object.update(self)
self.z = -self.y
self.bandage.update_from_parent()
self.shadow.update_from_parent()
示例5: update
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import update [as 别名]
def update(self):
if self.are_in_camera_area():
self.state.update()
Object.update(self)
self.z = -self.y
self.shadow.update_from_parent()
示例6: Object
# 需要导入模块: from object import Object [as 别名]
# 或者: from object.Object import update [as 别名]
import json
import os
from object import Object
secrets = Object()
path = os.path.abspath(os.path.join('/var/phantom', 'secrets.json'))
with open(path) as f:
lines = ''.join(f.readlines())
s = json.loads(lines)
secrets.update(s)
del path