Ask coding questions

← Back to all posts
Use REPI.IT with Pygame Zero?
ValerieGillon (0)

Hello,

I am trying to use repl.it with pygame zero and I can't make it work .

I added a requirements file . But when I click run, it says it does not recognize the keyword Actor

Any idea on how to run pygame zero on this ide?

Thanks!

Commentshotnewtop
eankeen (614)

hey!
so if you want to run pygame zero, first, you would wanna create a pygame repl (not a python one).

after you do that, then you would want to follow this documentation: https://pygame-zero.readthedocs.io/en/stable/ide-mode.html

the documentation states that you need to import pgzrun at the top of the file, and invoke the go function at the end. here is an example:

import pgzrun

WIDTH = 800
HEIGHT = 600

def draw():
    screen.clear()
    screen.draw.circle((400, 300), 30, 'white')

pgzrun.go()

i actually created a working repl, if you want to check it out, here :)

hope i could help

ValerieGillon (0)

@eankeen Great! Thank you so much! :)

eankeen (614)

@ValerieGillon yah, glad i could help out :)