graphics of table, double render
This commit is contained in:
parent
dbcf1005f3
commit
80410b8438
BIN
resources/images/table2.png
Normal file
BIN
resources/images/table2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 876 B |
BIN
resources/images/table3.png
Normal file
BIN
resources/images/table3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
@ -7,11 +7,19 @@ class Graphics:
|
||||
'floor': pygame.image.load('../resources/images/floor.jpg'),
|
||||
'table': pygame.image.load('../resources/images/table.png'),
|
||||
'waiter': pygame.image.load('../resources/images/waiter.png'),
|
||||
'table2': pygame.image.load('../resources/images/table2.png'),
|
||||
'table3': pygame.image.load('../resources/images/table3.png')
|
||||
}
|
||||
self.screen = pygame.display.set_mode((700, 750))
|
||||
self.block_size = 50
|
||||
self.height = 15
|
||||
self.width = 14
|
||||
self.screen = pygame.display.set_mode((self.block_size*self.width, self.block_size*self.height))
|
||||
|
||||
def drawBackground(self, matrix):
|
||||
for y in range(15):
|
||||
for x in range(14):
|
||||
self.screen.blit(self.image['floor'], (x * self.block_size, y * self.block_size))
|
||||
|
||||
for y in range(15):
|
||||
for x in range(14):
|
||||
self.screen.blit(self.image[matrix.get_type(x, y)], (x * self.block_size, y * self.block_size))
|
||||
|
@ -10,7 +10,7 @@ class Matrix:
|
||||
for x in range(14):
|
||||
for y in range(15):
|
||||
self.matrix[x][y] = Tile(type_='floor', watch_through=1)
|
||||
self.matrix[1][0].type = 'waiter'
|
||||
self.matrix[1][0].type = 'table3'
|
||||
self.matrix[1][0].walk_through = 0
|
||||
|
||||
def get_type(self, x, y):
|
||||
|
Loading…
Reference in New Issue
Block a user