Jump to content

Assets Protection Module.


webcaetano
 Share

Recommended Posts

Many people that using PhaserJS comes from Flash.

And some people question about the assets protection like this one dude:
http://www.html5gamedevs.com/topic/17849-i-saw-a-comment-that-really-saddened-me-about-html-5/?p=102333

 

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){})

Result:

https://camo.githubusercontent.com/d29b81014d6083d8f84bbf0a1d824cf5cc3eb828/687474703a2f2f692e696d6775722e636f6d2f346f526561696a2e706e67

 

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);

Result:
https://camo.githubusercontent.com/09678703ab7a90e465c0d490d09911ce6e4b2fd0/687474703a2f2f692e696d6775722e636f6d2f4177664e3147712e706e67

 

 

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

Hi, 

There's an phaser example on the repo.

https://github.com/webcaetano/image-scramble/blob/master/examples/phaserExample.html

 

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.

https://github.com/webcaetano/image-scramble/blob/master/examples/phaserExample.html#L8-L9

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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