I want to make maze game. I have the idea to 'leave' bitcoins in some rooms and players can pickup it like a penny from the street. And question is how to do it?

  • You need to be more specific. What part are you having trouble with? What have you tried? Creating a web-game is a broad topic. – Nick ODell Nov 14 '14 at 15:47

In a normal video game, in order to transfer an amount between two quantities, you can simply declare it in code.

var amountHeldByCharacter = ??;
var amountInJar = ??;
//Change amounts
amountHeldByCharacter = amountHeldByCharacter + amountInJar;
amountInJar = amountInJar - amountInJar;

In the game, however, the bitcoin will have to come from actual bitcoin addresses, so you'll have to have some function within your code,(call it PAY) that connects externally to the blockchain and transfers bitcoin from the game to a the user's address.

var gameAddress = "<some address connected to the game>";
var userAddress = "<some address provided by the user>";
var amountInJar = ??;
//Change amounts -- PAY(fromAddress, toAddress, amount);
PAY(gameAddress, userAddress, amountInJar);
amountInJar = amountInJar - amountInJar;

How to implement the PAY function is the hard part, but that seems to answer the essence of your question.


I believe the best solution will to use in-game currency (in fact many MMO games have such), that can be withdrawn to bitcoins, just like online casinos are cashing out their chips.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.