Core java game code