Hello,
Any Javascript widget can easily be embedded anywhere in WordPress.. either inside an HTML block in a page/post, or as a sidebar widget.
So your real question is:
1) Whether or not you *can* build the game in question in JavaScript or not: I’m not a developer, but I don’t see why not, especially considering JS can be run serverside now. There are even a plethora of JavaScript game engines out there: https://www.google.com/search?q=javascript+game+engines
2) Where or not *you* can build the game in JavaScript or not: which you’re the only one who can answer since no one here knows your skillset.
If you need technical advice on JavaScript or game development, I’ll suggest you head over to Stack Overflow, as this is really outside the scope of this WordPress support forum.
Good luck!