Jump to content

Offline availability of assets in a Phaser-powered mobile game?


atomicg
 Share

Recommended Posts

Hello, I'm developing a mobile game in phaser.io (and will wrap it in cocoon.js in future).

The game has levels that are unlocked through in-app purchases.

 

For each level, I plan to load the assets (images/sounds etc) through RESTful calls ,for example:

https://xyz.com/game/level1/resource/1.jpg

 

At the server level, for each REST call I will check whether the user has access privileges to the asset (ie has the user purchased the level) before serving the asset.

 

Here is my question:

Once the user has 'downloaded' a level's assets (using the technique described above) to his/her phone, I want the assets to be available to the user offline. In Phaser's AssetLoader, is the asset cached (in localstorage for ex) for future use?

 

Any other thoughts on this subject? 

 

Link to comment
Share on other sites

A similar question has been asked here: http://www.html5gamedevs.com/topic/8120-preload-heavy-file-from-localstorage-or-async-process-in-preload/

 

The 'proper' way to keep assets available when offline is through the use of the application cache and a manifest file. See this for an introduction to the process: http://www.html5rocks.com/en/tutorials/appcache/beginner/

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...