A game that allows players to experience the process of software development can be an excellent way to introduce coding concepts and programming techniques, including loops and conditional statements. Zachtronics Shenzhen I/O is a game that does this. It puts players in the shoes angry engineers who work for a boring firm and have to create computer chips by hand. They are presented with increasingly difficult circuits to design, starting with the making lights flash in a specific pattern.
The interface in the game looks very similar to tools used by developers in browsers and also teaches scripting. Screeps is another excellent example, which blends JavaScript code with massively multi-player online gaming to build self sustaining colonies. Both games do a wonderful job of teaching the basics while also slowly introduction of new ones.
https://mrworkspace.nl/2021/12/17/the-advantages-of-a-workspace-management-forum/