import pygame
import random
import time
from classes import Apple
SCREEN_WIDTH=800
SCREEN_HEIGHT=608
background=pygame.Surface((SCREEN_WIDTH,SCREEN_HEIGHT))
for i in range(0,25):
    for j in range(0,19):
        image=pygame.image.load('images/background.png')
        mask=(random.randrange(0,20), random.randrange(0,20), random.randrange(0,20))
        image.fill(mask, special_flags=pygame.BLEND_ADD)
        background.blit(image, (i*32,j*32))
pygame.init()
display=pygame.display.set_mode((SCREEN_WIDTH,SCREEN_HEIGHT))
clock=pygame.time.Clock()
apple=Apple()
apples = pygame.sprite.Group()
apples.add(apple)
game=True
while game:
    for event in pygame.event.get():
        if event.type==pygame.QUIT:
            game=False
    display.blit(background,(0,0))
    for apple in apples:
        display.blit(apple.image,apple.rect)
    pygame.display.flip()
    clock.tick(30)
pygame.quit()