Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit 07b3605

Browse files
committed
added capsule as field options
1 parent e560eaa commit 07b3605

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

DTOs.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def __init__(self, gameState=None, jsonString=None):
3333
else:
3434
layout = gameState.data.layout
3535
food = gameState.data.food
36+
capsules = gameState.data.capsules
3637
height, width = layout.height, layout.width
3738
self.gameField = [[PublicFields.EMPTY for x in range(width)] for y in range(height)]
3839
for x in range(height):
@@ -41,6 +42,9 @@ def __init__(self, gameState=None, jsonString=None):
4142
self.gameField[x][y] = PublicFields.WALL
4243
elif food[y][x]:
4344
self.gameField[x][y] = PublicFields.FOOD
45+
for idx, val in enumerate(capsules):
46+
self.gameField[val[1]][val[0]] = PublicFields.CAPSULE
47+
print(self.gameField)
4448
for agent in gameState.data.agentStates[:]:
4549
weakened = (agent.scaredTimer > 0)
4650
self.publicPlayers.append(PublicPlayer(isPacman=agent.isPacman,
@@ -111,5 +115,6 @@ class PublicFields:
111115
EMPTY = " "
112116
WALL = "%"
113117
FOOD = "°"
118+
CAPSULE = "o"
114119
PLAYER = "P"
115120

0 commit comments

Comments
 (0)