added scalig behavior to renderer.py

This commit is contained in:
romue
2021-05-18 11:25:29 +02:00
parent 2a880ccb4e
commit 27c251b656
2 changed files with 11 additions and 4 deletions

View File

@ -37,7 +37,7 @@ class GettingDirty(BaseFactory):
height, width = self.state.shape[1:]
self.renderer = Renderer(width, height, view_radius=0)
dirt = [Entity('dirt', [x, y], self.state[DIRT_INDEX, x, y]) for x, y in np.argwhere(self.state[DIRT_INDEX] > h.IS_FREE_CELL)]
dirt = [Entity('dirt', [x, y], (min(self.state[DIRT_INDEX, x, y],1)), 'scale') for x, y in np.argwhere(self.state[DIRT_INDEX] > h.IS_FREE_CELL)]
walls = [Entity('dirt', pos) for pos in np.argwhere(self.state[h.LEVEL_IDX] > h.IS_FREE_CELL)]
agents = [Entity('agent', pos) for pos in np.argwhere(self.state[h.AGENT_START_IDX] > h.IS_FREE_CELL)]