예제 #1
0
    def check_kill(self):
        """ Check killing of enemies """

        for elements in Enemies.enemylist:
            if self.xcord == elements.xcord and self.ycord + 1 == elements.ycord:
                Enemies.enemylist.remove(elements)
                ScoreBoard.changescore("enemy")
                os.system('aplay -q ./sounds/kill.wav&')
예제 #2
0
    def get_brickcoins(self, board):
        """ Get coins by hitting bricks """

        if np.core.defchararray.isdigit(board[self.ycord - 3][self.xcord]):
            val = int(board[self.ycord - 3][self.xcord])
            if val != 0:
                board[self.ycord - 3][self.xcord] = val - 1
                ScoreBoard.changescore("coins")
예제 #3
0
    def getcoins(self, board, direction):
        """ Normal Bricks """

        if direction == "right":
            if board[self.ycord][self.xcord + 1] == '$':
                ScoreBoard.changescore("coins")
                os.system('aplay -q ./sounds/coins.wav&')

        if direction == "left":
            if board[self.ycord][self.xcord - 1] == '$':
                ScoreBoard.changescore("coins")
                os.system('aplay -q ./sounds/coins.wav&')

        if direction == "down":
            if board[self.ycord + 1][self.xcord] == '$':
                ScoreBoard.changescore("coins")
                os.system('aplay -q ./sounds/coins.wav&')