code about java game