22
22
GREEN = (0 ,255 ,0 )
23
23
BLUE = (0 ,0 ,255 )
24
24
25
- background = pygame .image .load ('Images /background.png' ) #game background
25
+ background = pygame .image .load ('Media /background.png' ) #game background
26
26
font = pygame .font .Font (os .path .join (os .getcwd (),'fontdesign.ttf' ),42 ) #font of game display
27
27
score_text = font .render ('Score : ' + str (score ),True ,(255 ,255 ,255 )) #score display
28
28
29
29
# Generalized structure of the fruit Dictionary
30
30
def generate_random_fruits (fruit ):
31
- fruit_path = "Images /" + fruit + ".png"
31
+ fruit_path = "Media /" + fruit + ".png"
32
32
# 'x' determines where the fruit should be positioned on x-coordinate
33
33
# 'speed_x' determines how fast the fruit should move in x direction.Controls the diagonal movement of fruits
34
34
# 'speed_y' controls the speed of fruits in y-direction (UPWARD)
@@ -51,7 +51,7 @@ def generate_random_fruits(fruit):
51
51
generate_random_fruits (fruit )
52
52
53
53
def hide_cross_lives (x , y ):
54
- gameDisplay .blit (pygame .image .load ("Images /red_lives.png" ), (x , y ))
54
+ gameDisplay .blit (pygame .image .load ("Media /red_lives.png" ), (x , y ))
55
55
56
56
# Generic method to draw fonts on the screen
57
57
font_name = pygame .font .match_font ('fontdesign.ttf' )
@@ -102,7 +102,7 @@ def show_gameover_screen():
102
102
first_round = False
103
103
game_over = False
104
104
player_lives = 3
105
- draw_lives (gameDisplay , 690 , 5 , player_lives , 'Images /red_lives.png' )
105
+ draw_lives (gameDisplay , 690 , 5 , player_lives , 'Media /red_lives.png' )
106
106
score = 0
107
107
108
108
for event in pygame .event .get ():
@@ -112,7 +112,7 @@ def show_gameover_screen():
112
112
113
113
gameDisplay .blit (background , (0 , 0 ))
114
114
gameDisplay .blit (score_text , (0 , 0 ))
115
- draw_lives (gameDisplay , 690 , 5 , player_lives ,'Images /red_lives.png' )
115
+ draw_lives (gameDisplay , 690 , 5 , player_lives ,'Media /red_lives.png' )
116
116
117
117
for key , value in data .items ():
118
118
if value ['throw' ]:
@@ -144,9 +144,9 @@ def show_gameover_screen():
144
144
show_gameover_screen ()
145
145
game_over = True
146
146
147
- half_fruit_path = "Images /explosion.png"
147
+ half_fruit_path = "Media /explosion.png"
148
148
else :
149
- half_fruit_path = "Images /" + "half_" + key + ".png"
149
+ half_fruit_path = "Media /" + "half_" + key + ".png"
150
150
151
151
value ['img' ] = pygame .image .load (half_fruit_path )
152
152
value ['speed_x' ] += 10
0 commit comments