Skip to content

Commit ba869c4

Browse files
committed
Client (pygame): always load images from script directory
1 parent a606656 commit ba869c4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

client/more_examples/pygame/tictactoe_pygame.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
copies or substantial portions of the Software.
3030
"""
3131

32+
import os
3233
import pygame
3334
import threading
3435

@@ -63,7 +64,8 @@ def __init__(self, table_size):
6364
self.FPS = pygame.time.Clock()
6465

6566
def _load_mark(self, file_name):
66-
img = pygame.image.load(file_name)
67+
path = os.path.dirname(__file__) + '/'
68+
img = pygame.image.load(path + file_name)
6769
return pygame.transform.scale(img, (self.cell_size, self.cell_size))
6870

6971
# draws table representation

0 commit comments

Comments
 (0)