stupidpythonprojects/simongame/eventmanager.py
2016-09-12 15:19:48 +02:00

22 lines
421 B
Python

import pygame
from pygame.locals import *
class eventmanager(object):
def __init__(self):
self.eventlist = []
def update(self):
self.eventlist = pygame.event.get()
def getAll(self):
return self.eventlist
def getByType(self,Type):
list = []
for event in self.eventlist:
if event.type == Type:
list.append(event)
return list