The code isn't the idea, it's an implementation of it. Just because the code can be copyrighted doesn't mean the idea is as well.
Case in point of Sega vs EA over a patent on a game mechanic:
http://en.wikipedia.org/wiki/Crazy_T...%29#Legalities
http://www.gamasutra.com/view/featur...e_.php?print=1
If you have a really good, original idea/mechanic that you want to protect (and I am personally not condoning to the following because I don't like the idea of patenting game ideas) then consider patenting it.