本文整理匯總了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