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
def moveRight(): x = player.xcor() x += playerspeed player.setx(x)
def moveLeft(): x = player.xcor() x -= playerspeed player.setx(x)