Exemple #1
0
    def LEFT(self) :
        if ORIENTATION == 'NW' :
            newLoc = (self.x+1, self.y, self.z)

        else :
            newLoc = (self.x, self.y-1, self.z)

        if newLoc not in pathfinder.getValidMovement(self.gameGrid, self, True) : return

        self.gameGrid.removeBlock(self._arrow, self.x, self.y, self.z)

        self.x, self.y, self.z = newLoc

        self.gameGrid.setBlock(self.x, self.y, self.z, self._arrow, ow=False, insPos=-1)
        self._arrow.setUpdateFlag()
Exemple #2
0
    def UP(self):
        if ORIENTATION == "NW":
            newLoc = (self.x, self.y - 1, self.z)

        else:
            newLoc = (self.x + 1, self.y, self.z)

        if newLoc not in pathfinder.getValidMovement(self.gameGrid, self, True):
            return

        self.gameGrid.removeBlock(self._arrow, self.x, self.y, self.z)

        self.x, self.y, self.z = newLoc

        self.gameGrid.setBlock(self.x, self.y, self.z, self._arrow, ow=False, insPos=-1)
        self._arrow.setUpdateFlag()
Exemple #3
0
    def DOWN(self) :
        # Incriment location
        if ORIENTATION == 'NW' :
            newLoc = (self.x, self.y+1, self.z)

        else :
            newLoc = (self.x-1, self.y, self.z)

        # Opps, can't go there! Abort! Abort!
        if newLoc not in pathfinder.getValidMovement(self.gameGrid, self, True) : return

        # Remove the old arrow
        self.gameGrid.removeBlock(self._arrow, self.x, self.y, self.z)

        self.x, self.y, self.z = newLoc

        self.gameGrid.setBlock(self.x, self.y, self.z, self._arrow, ow=False, insPos=-1)
        self._arrow.setUpdateFlag()
Exemple #4
0
    def DOWN(self):
        # Incriment location
        if ORIENTATION == "NW":
            newLoc = (self.x, self.y + 1, self.z)

        else:
            newLoc = (self.x - 1, self.y, self.z)

        # Opps, can't go there! Abort! Abort!
        if newLoc not in pathfinder.getValidMovement(self.gameGrid, self, True):
            return

        # Remove the old arrow
        self.gameGrid.removeBlock(self._arrow, self.x, self.y, self.z)

        self.x, self.y, self.z = newLoc

        self.gameGrid.setBlock(self.x, self.y, self.z, self._arrow, ow=False, insPos=-1)
        self._arrow.setUpdateFlag()