pranadevil Posted September 2, 2015 Share Posted September 2, 2015 hi there i got an idea for a game, but i need to figure it out how to program it.what if i have a window asset and i want to clean it using the mouse? it is possible using phaser?how i can clean it and know how mmany percentage of the window is clean? Link to comment Share on other sites More sharing options...
CodeToWin Posted September 2, 2015 Share Posted September 2, 2015 I think a place to start is herehttp://phaser.io/examples/v2/create/gen-paint You could have a number of predrawn images that you load (your levels) with the goal to clear them out by clicking the mouse. I don't know about using an arbitrary BMP file. Given that the sizes of these are at least of order 100x100, that's 10,000 clicks just to clear ONE image. I don't think this is feasible for a game. The percentage clear would be the total number of pixels with the "clear" color (white or grey or whatever) divided by the total pixels. Link to comment Share on other sites More sharing options...
dimumurray Posted September 2, 2015 Share Posted September 2, 2015 I doth detect splatoon-like mechanics in the making.... Link to comment Share on other sites More sharing options...
pranadevil Posted September 2, 2015 Author Share Posted September 2, 2015 so there is no way to erase a bitmap by the mouse in phaser? just for predefined images? im searching more like the eraser in PAINT Link to comment Share on other sites More sharing options...
pranadevil Posted September 2, 2015 Author Share Posted September 2, 2015 I doth detect splatoon-like mechanics in the making....????????????? Link to comment Share on other sites More sharing options...
CodeToWin Posted September 2, 2015 Share Posted September 2, 2015 check out this thread, I think there is some useful information http://www.html5gamedevs.com/topic/11091-what-is-the-fastest-way-to-paint/ Link to comment Share on other sites More sharing options...
rich Posted September 2, 2015 Share Posted September 2, 2015 Yes you can erase a bitmap using a mouse pointer. Draw the image to a BitmapData then use BitmapData.circle to erase a mouse sized portion of it. jdnichollsc 1 Link to comment Share on other sites More sharing options...
jdnichollsc Posted September 2, 2015 Share Posted September 2, 2015 See my example: http://codepen.io/jdnichollsc/pen/jPRWXv Regards cjke 1 Link to comment Share on other sites More sharing options...
pranadevil Posted September 2, 2015 Author Share Posted September 2, 2015 See my example: http://codepen.io/jdnichollsc/pen/jPRWXv Regardswhats this?? var coinURI = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAgAElEQVR4Xtx9B3xc1ZX+N72PZkaj3qtlFUtyw8aAjQFjWigJhISakIRNA5LNpuymkE1hk2wSSEIIJISODRgwveNuy3KTLduyZau36b239/+d+6aqGExMwv7vj8Gamffe3PfOd08/5wrwf3B0v9C5EiJhBziuw2yJdCQ4QYfDEQUEEqhUSnDJe+I4/i+ZJAJwUUgk2KzViF0cx/XEOW5z3Ovvuej2Qff/wUdwxqYsOGNX+hgvtOP5 Link to comment Share on other sites More sharing options...
jdnichollsc Posted September 3, 2015 Share Posted September 3, 2015 Are the images in my example in base64 string, you can load any other image in any other format (jpg, png) Sorry for my bad english jeje cjke 1 Link to comment Share on other sites More sharing options...
Recommended Posts