1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| _mouseMove : function(e, that) {
if(!that.clicked) return;
if (pas_bloque) {
var offset = $(that.$elmt).offset(), x =e.pageX - offset.left, y = e.pageY - offset.top, i = -10;
for(i = -10; i< 10; i++) {
for(var a = -5; a< 5; a++) {
if(Math.random() < 0.2) {
that.context.clearRect(x + i,y + a,1,1);
k_index = parseInt((y + a)*img_width + (x + i));
//alert(k_index+' : '+img_grat_array[k_index] + ' w '+ img_width + ' y '+ y +' a '+a + ' x '+x+' i '+i);
if (img_grat_array[k_index]) {
gratte_tout ++;
img_grat_array[k_index] = 0;
//alert(gratte_tout);
}
}
}
}
if (gratte_tout > percent_coverage) {
pas_bloque = 0;
document.getElementById('spartooday').style.height = window_final_size;
if(version_tablet) {
sendDataSync('display_gain', 'ope=SPARTOODAY&init=display_gain', '../operations/spartooday/spartooday_ajax.php', 'GET');
}
else {
sendDataSync('display_gain', 'ope=SPARTOODAY&init=display_gain', 'operations/spartooday/spartooday_ajax.php', 'GET');
}
}
}
}, |
Partager