Sure, here’s an example. Put your game in a ./gamedir, and download nwjs for linux and plop it in the same directory. Run snapcraft and this will build a snap of your game, bundled with the nwjs runtime.
name: gamename # short name for game, all lower case
version: '1.0' # arbitrary version number, can be any text
summary: Game Name # Short human readable name of the application
This is a game ... # Multi-line 79 column wide description of game
confinement: strict # strictly confined application
# The apps section exposes a command to the running system
# The plugs allow access to the network, display, sound and input
command: desktop-launch $SNAP/nw
# 3 parts are needed
# metadata: directory containing a package.json used by nwjs to describe the application
# and set the initial screen resolution of the window
# nwjs: dumps the build of nwjs into the snap as-is. This was just downloaded from the nwjs
# website and is unchanged. Will get unpacked into the snap
# game: the actual unpacked game itself. Will also get dumped into the root of the snap
# along with nwjs.