It depends if the idea is copyrighted or trademarked. For example, a control scheme like WASD to move cannot be copyrighted. I know games like undertale and fnaf are fairly friendly towards fan games, but it's best to send an email and ask for permission if you are worried about something