forked from vgaNAR6ta/drags-and-nerds
Ajout du noise
This commit is contained in:
@@ -14,7 +14,7 @@ async function updateFromForm(){
|
||||
} else {
|
||||
UI_GLITCHER.clearImage()
|
||||
}
|
||||
|
||||
|
||||
UI_GLITCHER.render()
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ CANVAS.addEventListener("pointerdown", e => {
|
||||
let now = Date.now()
|
||||
|
||||
if(lastCommit === null || now - lastCommit > 100){
|
||||
let width = 20;
|
||||
let width = 50;
|
||||
if(e.pointerType == "touch"){
|
||||
width *= 2
|
||||
}
|
||||
@@ -55,8 +55,8 @@ CANVAS.addEventListener("pointerdown", e => {
|
||||
let deltaY = lastY !== undefined ? y - lastY : 0
|
||||
|
||||
width += Math.max(Math.abs(deltaX), Math.abs(deltaY))
|
||||
width += Math.random()*2
|
||||
|
||||
//UI_GLITCHER.addGlitch(x + (Math.random() * width) - width/2, y + (Math.random() * width) - width/2, width)
|
||||
UI_GLITCHER.addGlitch(x, y, width)
|
||||
UI_GLITCHER.render()
|
||||
|
||||
@@ -82,5 +82,11 @@ CANVAS.addEventListener("pointerdown", e => {
|
||||
applyGlitch(e)
|
||||
})
|
||||
|
||||
/*function startRendering(){
|
||||
UI_GLITCHER.render()
|
||||
requestAnimationFrame(startRendering)
|
||||
}
|
||||
startRendering()*/
|
||||
|
||||
setInterval(() => UI_GLITCHER.render(), 500)
|
||||
updateFromForm()
|
||||
Reference in New Issue
Block a user