Skip to content

Commit da3cb8c

Browse files
committed
Change directory to apps folder on Fruit Jam OS
1 parent c655dd3 commit da3cb8c

File tree

1 file changed

+16
-6
lines changed
  • Metro/Metro_RP2350_Match3/match3_game

1 file changed

+16
-6
lines changed

Metro/Metro_RP2350_Match3/match3_game/code.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,22 @@
2626
import adafruit_sdcard
2727
import msgpack
2828
import storage
29-
from match3_game_helpers import (
30-
Match3Game,
31-
STATE_GAMEOVER,
32-
STATE_PLAYING_SETCALLED,
33-
GameOverException,
34-
)
29+
try:
30+
from match3_game_helpers import (
31+
Match3Game,
32+
STATE_GAMEOVER,
33+
STATE_PLAYING_SETCALLED,
34+
GameOverException,
35+
)
36+
except ImportError:
37+
# Needed for Fruit Jam OS if "Play again" is selected at end of game
38+
os.chdir('/apps/Metro_RP2350_Match3')
39+
from match3_game_helpers import (
40+
Match3Game,
41+
STATE_GAMEOVER,
42+
STATE_PLAYING_SETCALLED,
43+
GameOverException,
44+
)
3545

3646
original_autoreload_val = supervisor.runtime.autoreload
3747
supervisor.runtime.autoreload = False

0 commit comments

Comments
 (0)