A game that lets players experience software development can be an excellent method of teaching programming concepts and concepts in coding, such as loops and conditional statement. Zachtronics Shenzhen I/O is a game that does this. It puts players in the shoes of disgruntled engineers who work for a drab company and have to build computer chips by hand. They are presented with increasingly difficult circuits to create, starting by making lights flash in a certain pattern.
The interface of the game is similar to the one you will find in browsers. Additionally, it also teaches scripting. Screeps is a great example, which incorporates JavaScript code with workplace management massively multi-player online gameplay in order to create self-sustaining colonies. Both games do a wonderful job of teaching fundamental concepts while gradually introducing new ones.