refactor GameLayer.cpp