Don't know if it qualifies as a "video game", but I wrote checkerboard-programming[0], a series of puzzles that require you to write js to match checkerboard patterns.<p>[0] <a href="https://www.checkerboardprogramming.com/" rel="nofollow">https://www.checkerboardprogramming.com/</a>
What is the age of your audience?<p>Screeps comes to mind, if JavaScript is okay. Human Resource Machine is lower level but useful for teaching basic concepts.<p>Good though they are, I would not recommend any of the Zachtronics games since they are focused on being coding puzzles, not teaching.
<a href="https://www.unrealengine.com/en-US/" rel="nofollow">https://www.unrealengine.com/en-US/</a>
Unreal Engine is free-ish and it's more fun than most educational games that I've seen.
TwilioQuest is quite good. It teaches JavaScript and Python, including setting up the runtimes and some basic git stuff.<p><a href="https://www.twilio.com/quest" rel="nofollow">https://www.twilio.com/quest</a>
Swift Playgrounds is pretty cool.<p><a href="https://www.apple.com/swift/playgrounds/" rel="nofollow">https://www.apple.com/swift/playgrounds/</a>
Microsoft MakeCode Arcade is great for learning to code with games.<p><a href="https://arcade.makecode.com" rel="nofollow">https://arcade.makecode.com</a>