A game that allows players to experience the process of software development can be an excellent method of teaching coding concepts and programming techniques, including loops and conditional statement. Zachtronics Shenzhen I/O is one game that accomplishes this. It puts players in the shoes of angry engineers who work for a drab company and must build computer chips by hand. They are presented with increasingly read this post here difficult circuits to design, beginning with making lights blink in a certain pattern.
The interface in the game appears very similar to tools used by developers in browsers and teaches scripting. Another excellent example is Screeps, which is a game that combines JavaScript coding with massively multiplayer online games to build self-sustaining colonies. Both games do a fantastic job of teaching basic concepts while also slowly introducing new ones.