2

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

Alderven
  • 7,569
  • 5
  • 26
  • 38
tobyns123
  • 21
  • 1

1 Answers1

1

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.

Grimmy
  • 3,992
  • 22
  • 25