A game that allows players to experience the process of software development can be a great way to teach programming concepts and coding like loops and conditional statement. Zachtronics Shenzhen I/O is a game that does this. It puts players in the shoes of unhappy engineers who work for a boring company and have to next build computer chips by hand. They are provided with increasingly challenging circuits to create, starting with the making lights flash in a particular pattern.
The interface of the game is similar to the one you see in browsers, and it helps students learn scripting. Another excellent example is Screeps which blends JavaScript programming and massively multiplayer online gaming to create self-sustaining colonies. Both games do an excellent job of teaching fundamental concepts while gradually introduce new ones.