5 import pygame.event as pge
6 import pygame.locals as pgl
9 class NajaEvent(object):
14 def post(cls, **attributes):
15 event = pge.Event(pgl.USEREVENT, naja_event_type=cls.TYPE,
21 return ev.type == pgl.USEREVENT and ev.naja_event_type == cls.TYPE
24 class SceneChangeEvent(NajaEvent):
29 super(SceneChangeEvent, cls).post(scene=scene)
32 class QuitGameEvent(NajaEvent):
37 super(QuitGameEvent, cls).post()