Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
improve if block for texas_holdem
  • Loading branch information
younik committed Sep 29, 2022
commit 26411e88ce80a2ef26163c5f2cdd7037360e182b
11 changes: 5 additions & 6 deletions pettingzoo/classic/rlcard_envs/texas_holdem.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,14 @@ def calculate_height(screen_height, divisor, multiplier, tile_size, offset):
+ np.ceil(len(self.possible_agents) / 2) * (screen_height * 1 / 2)
)

if self.screen is None:
if self.render_mode == "human":
if self.render_mode == "human":
if self.screen is None:
pygame.init()
self.screen = pygame.display.set_mode((screen_width, screen_height))
else:
pygame.font.init()
self.screen = pygame.Surface((screen_width, screen_height))
if self.render_mode == "human":
pygame.event.get()
elif self.screen is None:
pygame.font.init()
self.screen = pygame.Surface((screen_width, screen_height))

# Setup dimensions for card size and setup for colors
tile_size = screen_height * 2 / 10
Expand Down