Memuat gambar sebagai sprite di pygame
import pygame as pg
pg.init()
# The screen/display has to be initialized before you can load an image.
screen = pg.display.set_mode((640, 480))
IMAGE = pg.image.load('an_image.png').convert_alpha()
class Player(pg.sprite.Sprite):
def __init__(self, pos):
super().__init__()
self.image = IMAGE
self.rect = self.image.get_rect(center=pos)
Xanthous Xenomorph