Download

Help with scratch off effect

Hello All,

I have an assignment for school to create an Android Lotto Scratch Off game. Using a widget I set up the menu and random money materials in a uniform grid. Shows in the image below:

ec6e8d62de9a7b7e9262746a34b7045099ae1c34.jpeg

Now I am trying to create the scratch off feature. Where the player will drag their finger across the screen, gradually revealing the image below. Currently I am trying to accomplish this with the HUD. Shown below:

a49670e2f6d38dcff1af8bf3ba1973d8c14356c3.jpeg
6eb9f166cd5f3a023ccbd099e674722770753a2b.jpeg

Two for loops populate the draw material area with a bunch of small squares. My plan was to change the material properties as each one gets touched to ‘simulate’ the scratch effect.

Does anyone have a better way of doing this? This method simply is not working.

Any help you can offer will be greatly appreciated.

~rush