A game that allows players to experience the process of software development is an excellent method of teaching programming concepts and coding, such as loops and conditional statements. Zachtronics Shenzhen I/O is a game that accomplishes this. It puts players in the shoes of unhappy engineers who work for a boring company and must build computer chips by hand. The circuits they are asked to design become more difficult, starting with making the lights flash in a specific pattern.
The game's interface is similar to the one is found in browsers, and it is a great way to teach scripting. Screeps is a great example, which blends JavaScript code with massively multiplayer online games to build self sustaining colonies. Both games are excellent in teaching fundamental concepts and gradually introducing other players.