0

Hi I recently created a program which will moves an Image at bottom of screen with the white background.

Here is the code:

import pygame
import time
import os


pygame.init()
windowSize = [800,500]
screen = pygame.display.set_mode(windowSize)
white = pygame.color.Color('#FFFFFF')
x = 20
y = 20
picture = pygame.image.load('fire.png')
finished = False
while not finished:
    screen.fill(white)
    for i in range(1,2):
        x = x + 1
        time.sleep(0.006)
        if x == -200:
            exit()
    screen.blit(picture, (x,y))
    pygame.display.flip()
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            finished = True
pygame.quit()

Can Someone guide me how can I Make screen.fill() transparent?

Thank you.

0 Answers0