pisouvigne 5 years ago
parent e93a21aac7
commit 107d93cb08

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 899 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 925 B

@ -1,21 +1,21 @@
//Portes Logiques //Portes Logiques
var imageHeight = 50; var imageHeight = 70;
var imageWidth = 75; var imageWidth = 75;
var imageRotation = 0; var imageRotation = 0;
//Image //Image
const pathImg = "../img/"; const pathImg = "../img/";
const imageLogiqueEt = "and_test.png"; const imageLogiqueEt = "eee.png";
const imageLogiqueOu = "or_test.png"; const imageLogiqueOu = "zzz.png";
const imageLogiqueEtNon = "logiqueetnon.png"; const imageLogiqueEtNon = "nand.png";
const imageLogiqueInv = "non.png"; const imageLogiqueInv = "not_test.png";
const imageLogiqueNonOu = "aaa.png"; const imageLogiqueNonOu = "aaa.png";
const imageEnd = "idea_white.png"; const imageEnd = "idea_white.png";
//line //line
const colorLineInnactive = "black"; const colorLineInnactive = "black";
const colorLineActive = "#FFF033"; const colorLineActive = "#4CFEFE";//FFF033
const lineStroke = 5; const lineStroke = 4;
const pourcentageBreak = 15; const pourcentageBreak = 15;
//switch //switch

@ -60,6 +60,7 @@ function createLine(points, id) {
let newPoints = [startX, startY,startX + distance20, startY,endX - distance20,endY,endX,endY]; let newPoints = [startX, startY,startX + distance20, startY,endX - distance20,endY,endX,endY];
let line = new Konva.Line({ let line = new Konva.Line({
points: newPoints, points: newPoints,
fill : 'blue',
stroke: colorLineInnactive, stroke: colorLineInnactive,
strokeWidth: lineStroke, strokeWidth: lineStroke,
id: id, id: id,

@ -90,6 +90,67 @@ function tuto(){
initEnd(); initEnd();
} }
function creatorRandomPyramid(){
timeEnd = getRandomArbitrary(15, 50);
initTimer();
var premiereColonne = 2;
let still = premiereColonne;
let nmbColonne = 1;
while(still != 1){
still = still / 2;
nmbColonne++;
}
var logiqueCount = 0;
colonneTot = nmbColonne;
for (let i = 0; i < colonneTot; i++) {
liveColonneNumber.push([]);
}
premiereColonne = premiereColonne * 2;
for (let i = 0; i < colonneTot; i++) {
numberPerColonne[i] = premiereColonne - premiereColonne / 2;
premiereColonne = premiereColonne / 2;
for (let j = 0; j < numberPerColonne[i]; j++) {
logiqueCount++;
let type = null;
switch (getRandomArbitrary(0, 4)) {
case 0:
type = "et";
break;
case 1:
type = "ou";
break;
case 2:
type = "etnon";
break;
case 3:
type = "nonou";
break;
}
insertLogiqueColonne("logique" + logiqueCount, type, i);
}
}
logiques.forEach(function (element) {
createLinkAuto(element.name);
});
calculNombreSwitch();
switchCreator(numberOfSwitch);
createAllLinkSwitch();
initAllSwitch();
createEnd();
initEnd();
}
function generatorGame() { function generatorGame() {
timeEnd = getRandomArbitrary(15, 50); timeEnd = getRandomArbitrary(15, 50);

@ -93,7 +93,7 @@
initLayer(); initLayer();
generatorGame(); creatorRandomPyramid();
checkAllSortieLogique(); checkAllSortieLogique();
</script> </script>

Loading…
Cancel
Save