Starlight-30036225 / Ai-Assignment

Assets from Code the Classics
0 stars 0 forks source link

Displaying Ai pathing #9

Open Starlight-30036225 opened 7 months ago

Starlight-30036225 commented 7 months ago
def drawAIPath(self, screen):
    if not (self.player and self.player.path):
        return
    for i in range(self.player.path.__len__() - 1):
        pointA = ((self.player.path[i][0] * ((WIDTH - 100) / NUM_COLUMNS)) + 50, (self.player.path[i][1] * ((HEIGHT) / NUM_ROWS)))
        pointB = ((self.player.path[i+1][0] * ((WIDTH - 100) / NUM_COLUMNS)) + 50, (self.player.path[i+1][1] * ((HEIGHT) / NUM_ROWS)))
        pygame.draw.line(screen, (255,0,0), pointA , pointB, 10)