The code falls under a different law in and of itself. It's perfectly OK to reverse engineer and reimplement the engine, so long as we do it in a "clean room" i.e we don't use any of their original code, either in part or in whole. None of us are doing any such thing so we're perfectly ok.
Thanks for clearing the "assets" part, guys. I was worried about my fan-game using Nintendo assets. But do fan-games fall under the same rules as commercial games?