Here is a file made by web3 in js. it uses Ethereum's web3 .js library to communicate with the Blockchain. The project itself was not created by me. but I'm making it available to everyone.
use as a reference to make web3 games.
mediafire.com/file/zz9oa7yypfbozf2/c3web3metamask.zip/file
use as reference for any other web3 game project.