class gameData { constructor(hauteur, largeur) { this.hauteur = hauteur; this.largeur = largeur; } } function createSwitch(id, x, y) { var switche = { id : id, x : x, y : y, }; switchsInfo.push(switche); switchsInfoCopy.push(switche); switchs.push(id); var num = lineCount.length; lineCount.push(1); var rect1 = new Konva.Rect({ x: x, y: y, width: SwitchWidth, height: SwitchHeight, stroke: colorSwitchBorder, fill: colorSwitchInnactiveBackground, strokeWidth: 4, id: id, id3: null, }); layer.add(rect1); }