示例#1
0
 def generatenplacemag(self, player):
     import addons
     mag = addons.Magnet()
     my, mx = 2, self.getw() + self.getx() - 2
     if mag.select(mag.getmagrate()):
         self.magmap.append((my, mx))
     for i in self.magmap:
         my, mx = i[0], i[1]
         if player.getx() >= mx - 7 and player.getx() < mx:
             player.setx(player.getx() + 1)
             player.valid('w', self)
         if player.getx() >= mx and player.getx() <= mx + 7:
             player.setx(player.getx() - 1)
             player.valid('w', self)
     self.placemag()
     pass
示例#2
0
def moveRight():
    x = player.xcor()
    x += playerspeed
    player.setx(x)
示例#3
0
def moveLeft():
    x = player.xcor()
    x -= playerspeed
    player.setx(x)