As both Derxwna and Java's Missingno said, as long as the game is non-profit and does not damage the franchise, you should be in the clear.
The only fan-game I have ever heard of that was shut down by Nintendo was a Pokémon MMO, which gained too much popularity, to the point where Nintendo was worried it could damage sales of official games and was hence shut down.
Still, you will most probably never run into any real trouble.
The worst that might happen is that you receive a Cease-and-Desist letter, which is still just a heads-up warning, that unless you stop, then they will take legal action.
So long as you stop if you do receive a CnD letter, you are not in trouble, so don't worry about it!