Ask coding questions

← Back to all posts
Pygame Sprite Graphics?
_olatobi_ (3)

Does support sprite graphics? If so, how do you implement them?

Answered by Kai_Justice (226) [earned 5 cycles]
View Answer
Kai_Justice (226)

You'll have to import an image file if you want anything complicated, this website has a good amount of documentation on sprites.

_olatobi_ (3)

@Kai_Justice So do I have to download an image file locally on my PC?

Kai_Justice (226)

@_olatobi_ Yes, you'll have to download the image on your pc and upload it to replit.

_olatobi_ (3)

@Kai_Justice i've downloaded all the images that I need to use, do you know exactly how to implement them as sprites in my code?

  • thank you for the help so far
Kai_Justice (226)

@_olatobi_ I'm not exactly indepth at using pygame but here's what I've come up with on loading sprites.

_olatobi_ (3)

@Kai_Justice thanks so much man, I really appreciate your help :)

sugarfi (622) supports all the features of pygame (except maybe audio). I believe they implement that by piping an X11 screen to your repl using Websockets.

NarwhalFanatic (28)

I believe you maybe able to import an image as a file and then assign a sprite that file. Haven't tested it though.