Is there a way I can reset a Python Arcade window class without restarting the whole project?

Viewed 194

I have a 2D platformer game in one class I want to re-run so that the level changes when I recall it.

I have tried creating an attribute called reset(self) that when called runs the __init__(self) subroutine again but that gives the error:

*pyglet\gl\lib.py", line 107, in errcheck
    raise GLException(msg)
pyglet.gl.lib.GLException: b'invalid operation'*

I've tried so much but can't figure it out.

Anyone got any solutions I might be able to use?

Many Thanks

1 Answers

Definitely do not call __init__ a second time. You can do all the setup in the reset() method itself. __init__ can call reset() at least. The other option is using arcade.View.

Related