Update maingame.cpp

final code