本文整理汇总了Python中unit.Unit.movement方法的典型用法代码示例。如果您正苦于以下问题:Python Unit.movement方法的具体用法?Python Unit.movement怎么用?Python Unit.movement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unit.Unit
的用法示例。
在下文中一共展示了Unit.movement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: button_events
# 需要导入模块: from unit import Unit [as 别名]
# 或者: from unit.Unit import movement [as 别名]
def button_events(self, event):
# check for clicks on a button
# (not in mousebuttondown to allow for mouseover highlight)
for button in self.buttons.btn_list:
if "click" in button.handleEvent(event):
if button.caption == "B":
self.player_command.player_msg = \
"That was the round button"
if button.caption == "hi":
self.player_command.player_msg = \
"Nothing here but us buttons."
if button.caption == "MAKE IT SO!":
Unit.movement(self.grid_map, self.players)
self.player_command.player_msg = ""
""" check for unit-related button events """
for player in self.players.active_list:
for group in player.units:
for unit in group.group_list:
for button in unit.unit_btns:
if "click" in button.handleEvent(event):
if button.caption == "B":
unit.active = "True"
unit.txt_status = "Targeting"
self.player_command.player_msg = \
"Click on target tile."
elif button.caption == "A":
unit.txt_status = "A Button"
else:
unit.txt_status = "Unidentified Button"