An easy-to-use Web Monetization Plugin for HTML5 game frameworks, including Phaser and Pixi.
Repository structure:
In the plugin folder you will find the Game Web Monetization Plugin.
This folder contains the following:
Here is the complete documentation for the plugin, describing every property, method and interface it uses. You can view the docs online, or if you have the repo checked-out simply open plugin/docs/index.html
in a browser.
This folder contains the TypeScript source code for the plugin itself. Usually, you should use one of the dist files instead, but the full source is included as well. Please note that it is released under the MIT license.
Here you'll find the pre-bundled distribution files:
GameWebMonetization.js
is an ESM (ES Module), ready to import directly into your game code.GameWebMonetization.es5.js
is a pre-bundled ES5 compatible script, for use in<script>
tags.GameWebMonetization.d.ts
is a TypeScript Definitions file, with accompanying source map.
Please see the tutorial for further integration details.
In the game folder you will find a sample Phaser 3 game that demonstrates use of the Game Web Monetization Plugin.
The game is called 3 Candies! and is a fast-paced puzzle game. See if you can find the 3 matching candies before the time runs out. If you play the game in a Web Monetized browser then you will get an extra life and an extra choice of background to play with.
You can play the game here, too! Be sure to have the Web Monetization Extension installed in your browser to get the full benefits :)
You can find a comprehensive 7 part tutorial on using the Game Web Monetization Plugin on the Phaser web site.