on clear le code

This commit is contained in:
Baptiste 2023-12-31 14:55:19 +01:00
parent 8e23565602
commit 24d948bdbd

View file

@ -21,24 +21,6 @@ class Input {
let mouseX = (e.clientX - bounds.x)*this.canvas.width/bounds.width; let mouseX = (e.clientX - bounds.x)*this.canvas.width/bounds.width;
let mouseY = (e.clientY - bounds.y)*this.canvas.height/bounds.height; let mouseY = (e.clientY - bounds.y)*this.canvas.height/bounds.height;
//console.log(Math.round(mouseX),",",Math.round(mouseY)); //for debug
//if(this.parity){ ////// to create collisions for a map
// this.dmx=Math.round(mouseX);
// this.dmy=Math.round(mouseY);
// this.parity=!this.parity;
//}else{
// let mx = Math.round((e.clientX - bounds.x)*this.canvas.width/bounds.width);
// let my = Math.round((e.clientY - bounds.y)*this.canvas.height/bounds.height);
// let x = Math.min(mx,this.dmx);
// let y = Math.min(my,this.dmy);
// let w = Math.abs(mx-this.dmx);
// let h = Math.abs(my-this.dmy);
// this.toPrint+="new Square("+x.toString()+","+y.toString()+","+player.z.toString()+","+w.toString()+","+h.toString()+"),";
// navigator.clipboard.writeText(this.toPrint);
// maps[player.z].squares.push(new Square(x,y,player.z,w,h));
// this.parity=!this.parity;
//}
let dx = mouseX-player.x; let dx = mouseX-player.x;
let dy = mouseY-player.y; let dy = mouseY-player.y;