revised debug system to use Pygame event system