A game that allows players to play with software development is a great way to teach programming concepts and coding concepts like loops and conditional statement. Zachtronics Shenzhen I/O is a game that does this. It puts players in the shoes disgruntled engineers who work for a drab company and have to build computer chips manually. They are presented with increasingly difficult circuits to create, starting with making lights blink in a specific pattern.
The interface of the game looks very similar to tools for developers found in browsers and also teaches scripting. Another excellent example is Screeps which is a game that combines JavaScript programming and massively multiplayer online games to important source build self-sustaining colonies. Both games are excellent in teaching fundamental concepts and slowly introducing others.