Building game function