Poprawka wizualna
This commit is contained in:
parent
2cee412170
commit
b9fa16a5a9
@ -20,7 +20,8 @@ COLORS = {
|
|||||||
'lightgreen': (70, 238, 70),
|
'lightgreen': (70, 238, 70),
|
||||||
'red': (255, 0, 0),
|
'red': (255, 0, 0),
|
||||||
'lightblue': (120, 180, 230),
|
'lightblue': (120, 180, 230),
|
||||||
'iceblue': (186,242,239),
|
'iceblue': (186, 242, 239),
|
||||||
|
'blue': (0, 0, 255),
|
||||||
'orange': (255, 165, 0)
|
'orange': (255, 165, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
main.py
4
main.py
@ -81,6 +81,10 @@ class MainGameFrame:
|
|||||||
package_color = get_package_color(pack)
|
package_color = get_package_color(pack)
|
||||||
pygame.draw.rect(self.display, package_color,
|
pygame.draw.rect(self.display, package_color,
|
||||||
((pack_x * TILE_WIDTH) + 3, (pack_y * TILE_HEIGHT) + 3, TILE_WIDTH - 5, TILE_HEIGHT - 5))
|
((pack_x * TILE_WIDTH) + 3, (pack_y * TILE_HEIGHT) + 3, TILE_WIDTH - 5, TILE_HEIGHT - 5))
|
||||||
|
if pack.category == "freezed":
|
||||||
|
pygame.draw.rect(self.display, COLORS['blue'],
|
||||||
|
((pack_x * TILE_WIDTH) + 2, (pack_y * TILE_HEIGHT) + 2, TILE_WIDTH - 4,
|
||||||
|
TILE_HEIGHT - 4), 3)
|
||||||
|
|
||||||
def draw_nums(self):
|
def draw_nums(self):
|
||||||
for row in self.warehouse_map.tiles:
|
for row in self.warehouse_map.tiles:
|
||||||
|
@ -195,6 +195,9 @@ class Warehouse:
|
|||||||
pack_x, pack_y = self._set_package_position()
|
pack_x, pack_y = self._set_package_position()
|
||||||
package_field = self.tiles[pack_x][pack_y]
|
package_field = self.tiles[pack_x][pack_y]
|
||||||
new_package = Pack(lays_on_field=package_field)
|
new_package = Pack(lays_on_field=package_field)
|
||||||
|
categ_seed = random.random()
|
||||||
|
if categ_seed > 0.8:
|
||||||
|
new_package.category = "freezed"
|
||||||
new_package.size = random.randrange(1, 10)
|
new_package.size = random.randrange(1, 10)
|
||||||
if package_field.category.name in self.storage_types:
|
if package_field.category.name in self.storage_types:
|
||||||
package_field.capacity -= new_package.size
|
package_field.capacity -= new_package.size
|
||||||
|
Loading…
Reference in New Issue
Block a user