"""
import pygame.event as pge
+import pygame.locals as pgl
-class NajaEvent(pge.Event):
+class NajaEvent(object):
TYPE = "UNKNOWN"
@classmethod
def post(cls, **attributes):
- event = pge.Event(pge.USEREVENT, naja_event_type=cls.TYPE,
+ event = pge.Event(pgl.USEREVENT, naja_event_type=cls.TYPE,
**attributes)
pge.post(event)
@classmethod
def matches(cls, ev):
- return ev.type == pge.USEREVENT and ev.naja_event_type == cls.TYPE
+ return ev.type == pgl.USEREVENT and ev.naja_event_type == cls.TYPE
class SceneChangeEvent(NajaEvent):
@classmethod
def post(cls, scene):
super(SceneChangeEvent, cls).post(scene=scene)
+
+
+class QuitGameEvent(NajaEvent):
+ TYPE = "QUIT_GAME"
+
+ @classmethod
+ def post(cls):
+ super(QuitGameEvent, cls).post()