My kid was playing Lightbot at 6yo. Most programming toys I've seen have similar mechanics. I put together a cardboard version myself to help him practice some concepts (e.g. procedures), with the difference that it uses actual directions (up, down, left, right) instead of the usual forward, turn left, turn right commands, which in my observation was more intuitive.
He didn't seem to take much more interest in programming after mastering that, but he did eventually take interest in chess. The reason is that we borrowed a bunch of chess books from the library and he would go read them whenever he was bored, and he would play with his grandpa to try to apply the tricks he was reading about. Point being that having self-study and tight feedback loops seem to help in acquiring proficiency in a skill.
Personally, after the most beginner level, I'd start to move away from using game development as a motivator for learning programming simply because after some threshold, the math requirements ramp up substantially (e.g. implementing jumping in a side-scroller requires middle school level math at a very bare minimum). In my own journey, I've found that web development (using only the most vanilla subset of technologies) was a relatively gentle way to get into programming. The syntax is relatively forgiving, the building blocks are high level enough to allow easy creation of interesting interactive things, the built-in tooling in browsers nowadays are amazing and the tight feedback loop is there.
He didn't seem to take much more interest in programming after mastering that, but he did eventually take interest in chess. The reason is that we borrowed a bunch of chess books from the library and he would go read them whenever he was bored, and he would play with his grandpa to try to apply the tricks he was reading about. Point being that having self-study and tight feedback loops seem to help in acquiring proficiency in a skill.
Personally, after the most beginner level, I'd start to move away from using game development as a motivator for learning programming simply because after some threshold, the math requirements ramp up substantially (e.g. implementing jumping in a side-scroller requires middle school level math at a very bare minimum). In my own journey, I've found that web development (using only the most vanilla subset of technologies) was a relatively gentle way to get into programming. The syntax is relatively forgiving, the building blocks are high level enough to allow easy creation of interesting interactive things, the built-in tooling in browsers nowadays are amazing and the tight feedback loop is there.
YMMV