Skip to content

vardanyanlg/phaser3-webpack-playable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phaser3-parcel-playable-logo

Playable Ads in one file

Phaser 3 + Webpack 5 with auto base64 assets decode

A Phaser 3 project template for JavaScript (ES6 support via Babel) and Webpack 5 that includes local server with hot-reloading for development and production builds in one file with assets on base64.

You can also try Phaser Parcel Template or Pixi Webpack Template

Features

  • The project is assembled into one file and is ready for any ad networks.
  • Final build with minification and code optimization
  • All assets will automatically be base64 encoded and embedded in the project
  • Modern code with inheritance classes, arrow functions, as well as asynchronous code, and all this will work even in older browsers thanks to the built-in BabelJS

Requirements

Node.js (with npm) and I recommend installing and using Yarn 3.

Getting Started

You need to either download this project or clone it:

git clone https://github.com/vardanyanlg/phaser3-webpack-playable.git

Make sure you are in the project, if not then go there:

cd phaser3-webpack-playable

Now you need to install all the necessary dependencies for the project to work:

yarn install

Everything is ready to start the project. For local testing use (localhost:8000 will open auto in browser) and without stat warnings

yarn watch

Or use yarn start for start dev server with show stat warnings

To build the final file use

yarn build

The finished index.html file is waiting for you in the dist folder

Assets Loading

Resource loading is declared in js/PreloaderScene.js

this
    .addAudio("custom_name",'../audio/filename.mp3')
    .addTexture("custom_name2",'../img/filename2.png')
    .addBitmapText('custom_name3',require('../font/filename3.png'),require('../font/filename3.xml'))
    .addAtlas('custom_name4',require('../img/filename4.png'),require('../img/filename4.json'))

Use Yarn Plug'n'Play

If you're using Yarn and want to use Plug'n'Play to get rid of the "node_modules" folder, type yarn set version berry to force a version update and then run yarn install to remove the extra stuff and build links.

About

Playable Ads in one file on Phaser3 and Webpack

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages