changed agent image

This commit is contained in:
s452746 2021-04-09 18:08:16 +02:00
parent 51f912f22d
commit 71b310ad4c
3 changed files with 2 additions and 9 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@ -37,14 +37,8 @@ for name, val in {
) )
ICON = main_path + '/images/mine_icon.png' ICON = main_path + '/images/mine_icon.png'
SAPPER_IDLE = pg.image.load(main_path + '/images/sapper_idle/cpt_bomba.png') SAPPER_IDLE = pg.image.load(main_path + '/images/sapper_idle/agent.png')
SAPPER_RUNNING = []
for name in [
'cpt_bomba_left',
'cpt_bomba_right',
]:
SAPPER_RUNNING.append(pg.image.load(main_path + '/images/sapper_idle/' + name + ".png"))
DEFAULT_FIELD = [ DEFAULT_FIELD = [
[1, 3, 4, 5, 0, 1, 2, 3, 2, 0], [1, 3, 4, 5, 0, 1, 2, 3, 2, 0],

View File

@ -2,7 +2,7 @@ import pygame as pg
from agent import Agent from agent import Agent
from environment import Environment from environment import Environment
from const import WIDTH, HEIGHT, IMAGES, SAPPER_RUNNING, SAPPER_IDLE from const import WIDTH, HEIGHT, IMAGES, SAPPER_IDLE
class GameUi: class GameUi:
@ -20,7 +20,6 @@ class GameUi:
getattr(self.agent, coord) + (shift/8) if x != 7 getattr(self.agent, coord) + (shift/8) if x != 7
else int(getattr(self.agent, coord) + (shift/8)) else int(getattr(self.agent, coord) + (shift/8))
) )
self.agent.img = SAPPER_RUNNING[x % 2]
self.update() self.update()
self.clock.tick(15) self.clock.tick(15)
self.agent.img = SAPPER_IDLE self.agent.img = SAPPER_IDLE