Probably on newer titles that can make use of multi core processes. If the game is optimized for multithreaded performance then that four core is going to hold you back in comparison to any newer or same gen CPU with hyperthreading or more cores. If you play games that are primarily or entirely single core limited, then you won't see much difference on those titles but most games that are from the past two years are highly optimized for multithreaded performance.
I think the 4790k is the better option IF your motherboard is in good condition and if you can't afford a new platform with motherboard and memory. Honestly, might be better even if you could.
If you look here:
https://www.cpubenchmark.net/compare/Intel-i7-4790K-vs-AMD-Ryzen-5-2600/2275vs3243 you'll see the single core performance of the 4790k is SUBSTANTIALLY better than the Ryzen 5 2600 and the 4790k is capable of a total of 8 threads compared to the Ryzen's 12 threads, BUT there are not many games that can take advantage of more than 8 threads anyhow. About the only way the Ryzen is the better option is on games that are absolutely optimized for MANY threads OR if you are gaming, recording and streaming simultaneously, because then those other processes have threads free to handle those tasks, whereas the 4790k will not have as many free threads in that situation.
Dollar for dollar though, given that the CPUs are similarly priced but you'd need other hardware for the Ryzen, it's almost a no brainer.