fix an assertion bug in BarChartsNode
restructure GameFactory as a singleton