Game clones are in a legal gray area. Note that you do NOT have to copy source code in order to infringe copyright: the relevant legal criterion is "substantial similarity". In
Atari v. Philips, the court ruled that K.C. Munchkin, a Pac-Man-like game, was similar enough to Pac-Man to infringe because both involved a gobbler eating dots while being chased by ghost monsters -- despite different designs and colors being used for the gobbler and monsters, a different maze layout, different rules, and of course no code in common.
Note again that if you clone Tetris, YOU WILL BE SUED and you will probably lose. Tetris is the most vigorously defended game IP in the world, by a company that, like Oracle, is mostly legal department, and judges have ruled that the shapes of the tetrominoes, the manner in which they spin and fall, and the dimensions of the game board are all copyrightable game elements.