当前位置: 首页>>代码示例>>Python>>正文


Python Object.tick方法代码示例

本文整理汇总了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)
开发者ID:giulianoxt,项目名称:pyasteroids,代码行数:9,代码来源:gun.py

示例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)
开发者ID:giulianoxt,项目名称:pyasteroids,代码行数:14,代码来源:missile.py

示例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()
开发者ID:giulianoxt,项目名称:pyasteroids,代码行数:14,代码来源:spaceship.py

示例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)
	    #
	       
开发者ID:giulianoxt,项目名称:pyasteroids,代码行数:23,代码来源:enemyship.py

示例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
开发者ID:giulianoxt,项目名称:pyasteroids,代码行数:8,代码来源:asteroid.py


注:本文中的objects.Object.tick方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。