A game that allows players to experience software development could be an excellent way to teach programming concepts and concepts in coding like loops and conditional statement. Zachtronics Shenzhen I/O is a game that accomplishes this. It puts players in the shoes of disgruntled engineers who work for a dull company and are required to design computer chips manually. They are given increasingly complex circuits to design, beginning by making lights flash in a certain pattern.
The game’s interface is similar to the one you see in browsers, and it teaches scripting. Screeps is another excellent example that incorporates JavaScript code with massively multiplayer online games in order to create self sustaining colonies. Both games do a great job of teaching basic concepts as well as slowly introducing new ones.