britzl / defold-playable-ads

A project with Gulp tasks to bundle the Defold game into one HTML file.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Defold for Playable Ads

Build Status

A playable ad is an interactive advertisement, mostly used to promote mobile games. A playable ad acts as a demo of the game (or product), allowing users to quickly play the game directly in the ad before downloading it.

Facebook specifications for Playable Ads require that there be a single file for playable ad that contains all assets as part of that single HTML file and assets should be data uri compressed. Also playable asset size should be less than 2MB.

Play the demo project online. Please note that it does not use any external resources as required.

This project contains the Gulp tasks, which:

  1. Downloads bob.jar.
  2. Builds the project for the HTML5 platform using bob.jar.
  3. Combines all resources into one large HTML file. The asm.js binary of the Defold engine is compressed using zlib deflate.

Note: this project was created from the "mobile" project template. For this reason Android and iOS icons are set, iOS launch images (blank ones) are set.

Required Prerequisites

You will need Node.js, Java and Gulp CLI installed on your environment.

Ubuntu/Debian or Windows Subsystem for Linux (WSL)

sudo apt install -y --no-install-recommends java nodejs npm

npm install --global gulp-cli

macOS

Install brew and paste that in a macOS Terminal prompt:

brew install node
brew cask install java

npm install --global gulp-cli

Installation

git clone https://github.com/aglitchman/defold-playable-ads.git
cd defold-playable-ads
npm install

Usage

Run the gulp command to start the build process:

Command line

The resulting HTML file is located at /build/bundle/js-web/playable_ads/playable_ads.html.

This project uses bob.jar version 1.2.152. Change the download link bobJarDownloadUrl in gulpfile.js to use other version.

In Your Project

  1. Copy these files to your project root folder:
gulpfile.js
html5/engine_template.html
package.json
  1. Set html5/engine_template.html as custom HTML template in your game project settings. Also add path /node_modules to your .gitignore.
  2. Run npm install, then gulp.

About

A project with Gulp tasks to bundle the Defold game into one HTML file.


Languages

Language:JavaScript 62.3%Language:HTML 37.7%