Skip to content
This repository was archived by the owner on Feb 12, 2019. It is now read-only.

Debug mode

Pasquale Mangialavori edited this page Nov 24, 2016 · 6 revisions

Debug mode A specific build allows the developer to test a game on local before it is actually uploaded to our services.

Since some of the features implemented into GamifiveSDK depend on Gamifive's environment (API, configuration, etc.), the debug mode provides mocks for these features in order to simulate Gamifive's environment.

Set the debug environment

  1. Include the debug SDK version in your index.html do not forget to change debug with dist in the script tag before send the package

Debug (while testing in local)

    <script src="http://static.newton.pm/js/v2.2.3/newton.min.js"></script> 
    <script src="http://s.motime.com/js/wl/webstore_html5game/gfsdk/2.x.x/debug/gfsdk.js"></script>

Prod (Before sending us the package) without Newton script

    <script id="gfsdk" src="http://s.motime.com/js/wl/webstore_html5game/gfsdk/dist/gfsdk.min.js"></script>
  1. Serve statically the game folder with appsworld.gamifive-app.com as origin

For the second point you need:

2.1 Install NodeJS and NPM in your system.

2.2 Install http-server npm package globally

    npm install http-server -g

2.3 Edit your hosts file

Add this line

   127.0.0.1 local.appsworld.gamifive-app.com

into your hosts file

/private/etc/hosts file (Mac)
C:\Windows\System32\drivers\etc\hosts (Windows)

On Mac you can simply append this line at the end of the file in this way:

sudo -i # Enter the password
sudo echo '127.0.0.1 local.appsworld.gamifive-app.com' >> /private/etc/hosts;
exit

(Guide to edit hosts file on any platform http://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/)

2.4 Serve the gamepath

Serve the gamepath in this way from the cmd line

   http-server <myAwesomeGameFolder> -p 5050 -a local.appsworld.gamifive-app.com

Then open the browser to

    http://local.appsworld.gamifive-app.com:5050/index.html

That's it! Now you can test your implementation of the SDK. Open a issue on github if you encounter any issues

Clone this wiki locally