A game that allows players to experience the process of software development is a great method to teach coding and programming concepts like loops and conditional statements. Zachtronics Shenzhen I/O is one game that does this. It puts players in the shoes angry engineers who work for a drab company and are required to design computer chips manually. They are presented with increasingly difficult circuits to design. They begin with making lights flash in a specific pattern.
The interface https://mrworkspace.nl/2010/05/11/the-news-from-software-development-world-game/ in the game appears very similar to web browser’s developer tools and also teaches scripting. Another great example is Screeps, which incorporates JavaScript programming and massively multiplayer online games to create self-sustaining colonies. Both games do a great job of teaching basic concepts as well as slowly introduce new ones.