A game that allows players to play with software development is an excellent way to teach programming concepts and concepts in coding like loops and conditional statement. Games that accomplish this include Zachtronics Shenzhen I/O which puts players in the shoes of dissatisfied engineers who work for an uninteresting chip company and must build computer chips by hand. They are given increasingly complex circuits to design, starting by making lights flash in a particular pattern.
The interface in the game looks very similar to the tools used by developers in browsers and teaches scripting. Another excellent example is Screeps which blends JavaScript coding with massively multiplayer online gaming to build self-sustaining colonies. Both games do a wonderful job of teaching fundamental concepts as well as slowly introduction of new ones.