|
|
@ -83,6 +83,12 @@ text_surface = my_font.render('Clicks: ' + str(clicks), False, (255, 255, 255)) |
|
|
|
|
|
|
|
bg = pygame.image.load("bg.png") |
|
|
|
|
|
|
|
explosion_frames = [] |
|
|
|
for i in range(64): |
|
|
|
explosion_frames.append(pygame.image.load("explosion/exp_frame_"+str(i)+".png")) |
|
|
|
|
|
|
|
explosion_frames_nr = 0 |
|
|
|
explosion_on = 0 |
|
|
|
while True: |
|
|
|
if random.randint(1, 100) == 50: |
|
|
|
for pumpkin in list_pumpkins: |
|
|
@ -103,6 +109,13 @@ while True: |
|
|
|
|
|
|
|
DISPLAYSURF.blit(text_surface, (0,0)) |
|
|
|
|
|
|
|
if explosion_on == 1: |
|
|
|
DISPLAYSURF.blit(explosion_frames[explosion_frames_nr], (200,200)) |
|
|
|
explosion_frames_nr = (explosion_frames_nr +1) |
|
|
|
if explosion_frames_nr == 64: |
|
|
|
explosion_on = 0 |
|
|
|
explosion_frames_nr = 0 |
|
|
|
|
|
|
|
if event.type == MOUSEBUTTONDOWN: |
|
|
|
mouse_pos = event.pos # Now it will have the coordinates of click point. |
|
|
|
print('Click') |
|
|
@ -114,6 +127,7 @@ while True: |
|
|
|
mus_nede = 1 |
|
|
|
print('Touched') |
|
|
|
clicks = clicks + 1 |
|
|
|
explosion_on = 1 |
|
|
|
text_surface = my_font.render('Clicks: ' + str(clicks), False, (255, 255, 255)) |
|
|
|
elif event.type == MOUSEBUTTONUP: |
|
|
|
mus_nede = 0 |
|
|
|