本文整理汇总了Python中objects.Object.tick方法的典型用法代码示例。如果您正苦于以下问题:Python Object.tick方法的具体用法?Python Object.tick怎么用?Python Object.tick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类objects.Object
的用法示例。
在下文中一共展示了Object.tick方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tick
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import tick [as 别名]
def tick(self, time_elapsed):
Object.tick(self, time_elapsed)
self.elapsed += time_elapsed
if (self.elapsed >= self.duration):
self.lvl.remove_object(self)
示例2: tick
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import tick [as 别名]
def tick(self, time_elapsed):
if (hasattr(self.target, 'destroyed') and self.target.destroyed):
self.lvl.remove_object(self)
return
self.dir = (self.target.shape.position - self.shape.position).normalizing()
v = self.dir.scalar(self.velocity)
self.shape.velocity = v
Object.tick(self, time_elapsed)
示例3: tick
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import tick [as 别名]
def tick(self, time_elapsed):
Object.tick(self, time_elapsed)
self.update_mouse_track(time_elapsed)
self.update_spinning(time_elapsed)
self.update_strafe(time_elapsed)
self.simple_gun.tick(time_elapsed)
self.simple_missile.tick(time_elapsed)
self.collision_set = self.keep_colliding
self.keep_colliding = set()
示例4: tick
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import tick [as 别名]
def tick(self, time_elapsed):
Object.tick(self, time_elapsed)
self.elapsed += time_elapsed
if (self.elapsed >= self.time_interval_shot):
self.elapsed = 0.
_info = {
'destructible' : False,
'destroys_player' : False,
'target' : False
}
vec_dir = (self.level.ship.shape.position - self.shape.position - self.gun_pos).normalizing().scalar(70.)
bullet_pos = self.shape.position + self.gun_pos
shape_bull = Shape(0.01, bullet_pos)
shape_bull.velocity = vec_dir
#
#(self, model, shape, element, lvl, duration, damage)
obj_sh = SimpleShootInvasor(self.level.models['InvasorSimpleGun'][0], shape_bull, _info, self.level, 20, 5)
self.level.add_object(obj_sh)
#
示例5: tick
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import tick [as 别名]
def tick(self, time_elapsed):
Object.tick(self, time_elapsed)
if (self.asteroid_type == 'artificial'):
self.shot_tick_counter = (self.shot_tick_counter + 1) % self.shot_tick_interval
if (self.shot_tick_counter == 0):
self.shot = True