Jump to content

Assets Protection Module.


Recommended Posts

Many people that using PhaserJS comes from Flash.

And some people question about the assets protection like this one dude:


Yes it's true that get assets in html5 offers zero difficult.


I made a module that offers some dificult to get the assets.

It simple shuffle the image based on seed. Very easy to use

Like that.

// nodejsvar imgScramble = require('image-scramble');imgScramble({    image:'test/sample2.png', // source    seed:'Kappa', // seed    sliceSize:5, // slice size    dest:'test/sample2_crop.png' // destination},function(err){})




To unshuffle on PhaserJS

// phaserJSvar bmp = unscrambleImg(img,sliceSize,'Kappa',game.add.bitmapData(img.width,img.height));var sprite = game.add.sprite(0, 0, bmp);




Github Link : https://github.com/webcaetano/image-scramble


I'll soon increase the performance and make a gulp module of that.

Hope you guys like it.

Link to comment
Share on other sites

I can't make your code work. Could you include an example in the GitHub repo or do a Phaser sandbox to demonstrate how to use it?


I can scramble the images but I don't manage to unscramble them in the code.


I know it's supposed to be simple but I don't manage to do it. I don't post any code because I do exactly what you do in the doc.

Link to comment
Share on other sites


There's an phaser example on the repo.



Did you install the unscramble-img ??



bower install unscramble-img



It have 2 small dependencies. When you install via bower you also have to add the path of his dependencies.


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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