Beispiel #1
0
 def display(self, screen, offset_x, offset_y):
     color = cons.PAINT['S']
     if self.process:
         color = cons.PAINT['PROCESS']
         self.process = False
     screen.fill(color, [cons.cell_to_position(self.position_x,offset_x),
                              cons.cell_to_position(self.position_y,offset_y), cons.CELL_SIZE, cons.CELL_SIZE])
     cons.display_agent_label(self.position_x, self.position_y, offset_x, offset_y, self.index, screen)
 def display(self, screen, offset_x, offset_y):
     for y in range(self.height):
         for x in range(self.width):
             screen.fill(cons.PAINT[self.grid[y][x]], [
                 cons.cell_to_position(x, offset_x),
                 cons.cell_to_position(y, offset_y), cons.CELL_SIZE,
                 cons.CELL_SIZE
             ])
Beispiel #3
0
    def display(self, screen, offset_x, offset_y):
        screen.fill(cons.PAINT['p'], [
            cons.cell_to_position(self.position_x, offset_x) + 1,
            cons.cell_to_position(self.position_y, offset_y) + 1,
            cons.CELL_SIZE - 2, cons.CELL_SIZE - 2
        ])

        cons.display_agent_label(self.position_x, self.position_y, offset_x,
                                 offset_y, self.index, screen)
    def display(self, screen, offset_x, offset_y):
        image_path = "Figures/"
        image_path += self.heading
        image_path += ".png"
        image = pygame.image.load(image_path)
        image = pygame.transform.scale(image, (cons.CELL_SIZE, cons.CELL_SIZE))

        screen.blit(image, [
            cons.cell_to_position(self.position_x, offset_x),
            cons.cell_to_position(self.position_y, offset_y)
        ])
        cons.display_agent_label(self.position_x, self.position_y, offset_x,
                                 offset_y, self.index, screen)