本文整理汇总了Python中weapon.Weapon.controls['thrust']方法的典型用法代码示例。如果您正苦于以下问题:Python Weapon.controls['thrust']方法的具体用法?Python Weapon.controls['thrust']怎么用?Python Weapon.controls['thrust']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类weapon.Weapon
的用法示例。
在下文中一共展示了Weapon.controls['thrust']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update
# 需要导入模块: from weapon import Weapon [as 别名]
# 或者: from weapon.Weapon import controls['thrust'] [as 别名]
def update(self, delta_time):
if self.cooldown <= 0 and self.controls['attack']:
self.cooldown = self.weapon_cooldown
weapon = Weapon(self.functions)
weapon.pos_x = self.pos_x
weapon.pos_y = self.pos_y
weapon.angle = self.angle
weapon.max_speed = 100 + self.speed
weapon.controls['thrust'] = 1
self.ignore_list.append(weapon.polygon)
self.functions['add_entity'](weapon, etype='collider')
else:
self.cooldown -= self.weapon_cooldown * delta_time
return Entity.update(self, delta_time)