We built something like this. The API and dev platform is still in it's infancy, but we're waiting for a developer to sign up to create a game before solidifying more in the API. We've already built two games on our own platform.
Here's how we built it:
The developer provides a package with server and client modules. The server is in node.js. We make a couple of calls into the developers code:
startGame(playerOne, playerTwo, wager, ...)
makeMove(playerId, moveData)
playerTimedOut(playerId)
etc.
We also provide an API for the dev to call:
winGame(winningPlayer, losingPlayer)
drawGame()
updateClients(gameData)
etc.
That handles the server logic and the developer doesn't need to worry about bitcoin transactions, security, hosting, operations, database, etc. The games files tend to be very focused on the game rules because we handle everything else.
On the client side, the dev provides .html, .css, and .js.
We dynamically load the html, js and css and place it in the "game area" of our page. We call into the .js with startGame, timeoutTick, updateGame, etc.
We also provide an API on the client side for communicating back to the server.
That's pretty much it. We share 40% of the revenue a game makes back with the developer. VERY fair considering the amount of work needed to make a new game on the platform vs. the amount of work we spent creating it, securing it, serving it, operating it, etc.
Check out the site at
https://www.moocoin.com to see the two games we already created. We have a third game on the way, too.
If you want to build something on the platform, or if you just need help getting this project off the ground, let us know.
Thanks,
MooCoin