observer pattern gameloop