I would like to know how to draw images using pygame. I know how to load them.
I have made a blank window.
When I use screen.blit(blank, (10,10))
, it does not d
import pygame, sys, os
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((100, 100))
player = pygame.image.load(os.path.join("player.png"))
player.convert()
while True:
screen.blit(player, (10, 10))
pygame.display.flip()
pygame.quit()
Loads the file player.png
.
Run this and it works perfectly. So hopefully you learn something.