本文整理汇总了Python中Client.move方法的典型用法代码示例。如果您正苦于以下问题:Python Client.move方法的具体用法?Python Client.move怎么用?Python Client.move使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client.move方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tick
# 需要导入模块: import Client [as 别名]
# 或者: from Client import move [as 别名]
def tick(self):
super(Player,self).tick()
self.placeCooldown -=1
self.xa = 0
self.ya = 0
self.centreX= self.x+32
self.centreY= self.y+62
xx = self.centreX >>5
yy = self.centreY >>5
soundFXs = Sounds.Audio(False)
if Keyboard.keys['w']:
self.ya=-1
if Keyboard.keys['s']:
self.ya=1
if Keyboard.keys['a']:
self.xa=-1
if Keyboard.keys['d']:
self.xa=1
if self.xa != 0 or self.ya != 0:
self.isMoving = not self.move(self.xa, self.ya)
VRClient.move(self.x,self.y)
if gui.isMultiplayer == True:
Client.move(self.x,self.y,self.movingDir,self.isSwimming)
#soundFXs.Plysound(True,False,False,False,False)
else:
self.isMoving = False
soundFXs.Plysound(False,False,False,False,False)
if self.getTileUnder().getId() == Tile.water.getId()or self.getTileUnder().getId() == Tile.larva.getId() or self.getTileUnder().getId() == Tile.quicksand.getId():
self.isSwimming = True
else:
self.isSwimming = False
if self.getTileUnder().getId() == Tile.larva.getId()or self.getTileUnder().getId() == Tile.quicksand.getId():
if self.health < 0:
self.health = 0
self.health = self.health - 1
if self.health <= 0:
gui.gameOver = True
gui.defeat = True
if self.movingDir == 0:self.selectedTile=[xx,yy+1]#up
if self.movingDir == 1:self.selectedTile=[xx,yy-3]#down
if self.movingDir == 2:self.selectedTile=[xx-1,yy-1]#left
if self.movingDir == 3:self.selectedTile=[xx+1,yy-1]#right
if self.selectedTile[0]<<5 != self.inHand.x or self.selectedTile[1]<<5!=self.inHand.y:
self.inHand.x = self.selectedTile[0]<<5
self.inHand.y = self.selectedTile[1]<<5
self.inHand.CanPlace()
else:
self.inHand.x = self.selectedTile[0]<<5
self.inHand.y = self.selectedTile[1]<<5
if Keyboard.keys['e'] and self.placeCooldown <0:
if self.inHand.placeInLevel():self.placeCooldown = 20