diff --git a/src/environment.py b/src/environment.py index 21e1725..5b6474d 100644 --- a/src/environment.py +++ b/src/environment.py @@ -3,7 +3,7 @@ from random import choices def generate_field() -> List[List[int]]: - return [choices(range(9), weights=[8, 8, 4, 4, 4, 4, 4, 4, 4], k=10) for _ in range(10)] + return [choices(range(11), weights=[10, 10, 4, 4, 4, 4, 4, 4, 4, 4, 4], k=10) for _ in range(10)] class Environment: diff --git a/src/main.py b/src/main.py index 198f84f..cda2a9e 100644 --- a/src/main.py +++ b/src/main.py @@ -1,9 +1,9 @@ import pygame as pg -from const import ICON from agent import Agent from game_ui import GameUi from environment import Environment +from const import ICON, IMAGES_MAPPING def main(): @@ -31,8 +31,8 @@ def main(): elif event.key == pg.K_w and agent.y*80 > 0: game_ui.move('y', -1) elif event.key == pg.K_SPACE: - if env.field[agent.y][agent.x] in [2, 3]: - env.field[agent.y][agent.x] -= 2 + if env.field[agent.y][agent.x] > 3: + env.field[agent.y][agent.x] = IMAGES_MAPPING[env.field[agent.y][agent.x]] game_ui.update()