7
7
wn .tracer (0 )
8
8
9
9
# Register images/shapes
10
- images = ["wizard_right.gif" , "wizard_left.gif" , "treasure .gif" , "wall.gif" , "enemy_right.gif" , "enemy_left.gif" ]
10
+ images = ["Python-Projects\Maze\ wizard_right.gif" , "Python-Projects\Maze\ wizard_left.gif" , "Python-Projects\Maze\gold_chest .gif" , "Python-Projects\Maze\ wall.gif" , "Python-Projects\Maze\ enemy_right.gif" , "Python-Projects\Maze\ enemy_left.gif" ]
11
11
for image in images :
12
12
turtle .register_shape (image )
13
13
@@ -23,7 +23,7 @@ def __init__(self):
23
23
class Player (turtle .Turtle ):
24
24
def __init__ (self ):
25
25
turtle .Turtle .__init__ (self )
26
- self .shape ("wizard_right.gif" )
26
+ self .shape ("Python-Projects\Maze\ wizard_right.gif" )
27
27
self .color ("blue" )
28
28
self .penup ()
29
29
self .lives = 3
@@ -56,7 +56,7 @@ def go_left(self):
56
56
move_to_x = player .xcor () - 24
57
57
move_to_y = player .ycor ()
58
58
59
- self .shape ("wizard_left.gif" )
59
+ self .shape ("Python-Projects\Maze\ wizard_left.gif" )
60
60
61
61
# Check if space has wall
62
62
if (move_to_x , move_to_y ) not in walls :
@@ -67,7 +67,7 @@ def go_right(self):
67
67
move_to_x = player .xcor () + 24
68
68
move_to_y = player .ycor ()
69
69
70
- self .shape ("wizard_right.gif" )
70
+ self .shape ("Python-Projects\Maze\ wizard_right.gif" )
71
71
72
72
# Check if space has wall
73
73
if (move_to_x , move_to_y ) not in walls :
@@ -90,7 +90,7 @@ def destroy(self):
90
90
class Treasure (turtle .Turtle ):
91
91
def __init__ (self , x , y ):
92
92
turtle .Turtle .__init__ (self )
93
- self .shape ("treasure .gif" )
93
+ self .shape ("Python-Projects\Maze\gold_chest .gif" )
94
94
self .color ("gold" )
95
95
self .penup ()
96
96
self .speed (0 )
@@ -104,7 +104,7 @@ def destroy(self):
104
104
class Enemy (turtle .Turtle ):
105
105
def __init__ (self , x , y ):
106
106
turtle .Turtle .__init__ (self )
107
- self .shape ("enemy_left.gif" )
107
+ self .shape ("Python-Projects\Maze\ enemy_left.gif" )
108
108
self .color ("red" )
109
109
self .penup ()
110
110
self .speed (0 )
@@ -122,11 +122,11 @@ def move(self):
122
122
elif self .direction == "left" :
123
123
dx = - 24
124
124
dy = 0
125
- self .shape ("enemy_left.gif" )
125
+ self .shape ("Python-Projects\Maze\ enemy_left.gif" )
126
126
elif self .direction == "right" :
127
127
dx = 24
128
128
dy = 0
129
- self .shape ("enemy_right.gif" )
129
+ self .shape ("Python-Projects\Maze\ enemy_right.gif" )
130
130
else :
131
131
dx = 0
132
132
dy = 0
@@ -227,7 +227,7 @@ def setup_maze(level):
227
227
# Check if it is an X (wall)
228
228
if character == "X" :
229
229
pen .goto (screen_x , screen_y )
230
- pen .shape ("wall.gif" )
230
+ pen .shape ("Python-Projects\Maze\ wall.gif" )
231
231
pen .stamp ()
232
232
# Add coordinates to wall
233
233
walls .append ((screen_x , screen_y ))
0 commit comments