difficulty et étoiles

master
pisouvigne 5 years ago
parent 3115b205ef
commit 98f1c1492b

@ -0,0 +1,5 @@
Niveau 1 : 3 porte "et"
Niveau 2-5 : 2 porte "et" 1 porte "ou" / 2 porte "ou" 1 porte "et"
Niveau 6-10 : 4/5 porte "et" et "ou"
Niveau 11-20 : 4/5 porte "et" "ou" "non-ou" "non-et" "non" ...
Avec temps qui diminu en permanence

@ -1,178 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="https://unpkg.com/konva@6.0.0/konva.min.js"></script>
<script src="js/const.js"></script>
<script src="js/func.js"></script>
<script src="js/logique.js"></script>
<script src="js/init.js"></script>
<script src="js/createElement.js"></script>
<script src="js/easytimer.min.js"></script>
<script src="js/timer.js"></script>
<script src="js/creator.js"></script>
<link href="https://use.fontawesome.com/releases/v5.0.4/css/all.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Bitter:wght@700&display=swap" rel="stylesheet">
<meta charset="utf-8" />
<title>Make It True</title>
</head>
<body>
<!-- The Modal -->
<div id="myModal" class="modal">
<!-- Modal content -->
<div class="modal-content">
<div class="modal-header" align=center>
<br>
<h1>Game Over</h1>
<br>
</div>
<div class="modal-body" align=center>
<br>
<p>Temps total : 13 m 40 s</p>
<p>Temps moyen par niveau : 20.5s</p>
<p>Score moyen par niveau : 4.5</p>
<br>
<h2>Score total : 140</h2>
<br>
<input type="text" placeholder="Pseudo">
<button>Envoyer son score</button>
<br><br><br>
</div>
<div class="modal-footer">
<br>
<button onclick="window.location.href='index.html'">Home</button>
<br>
<br>
</div>
</div>
</div>
<div id="header-container">
<h1 align=center>Niveau <a id="niveau">0</a></h1>
<div align=center>
<a>Temps :</a>
<a id="timer">0 m 0 s</a>
<a id="timerend">20</a>
</div>
<div id="progressBar"></div>
</div>
<div id="play-container"></div>
<a onclick="reset()" style="cursor:pointer;">Click</a>
<script>
var mobile = false;
var switchs = new Array(), lineCount = new Array(), logiques = new Array(),lines = [], endLines = [],end, switchsInfo= [], switchsInfoCopy = [],lineRemove = [];
var niveauActuel = localStorage.getItem("niveau");
if(niveauActuel == null){
niveauActuel = 1;
}
let niveauhtml = document.getElementById('niveau');
niveauhtml.innerHTML = niveauActuel;
var layer = new Konva.Layer();
let container = document.getElementById('play-container');
container.style.height = innerHeight /100*80 + "px";
var width = container.offsetWidth;
var height = container.offsetHeight;
var stage = new Konva.Stage({
container: 'play-container',
/*rotation: -90,
x: 20,
y: 1000,*/
width: width,
height: height,
});
stage.add(layer);
initLayer();
creatorRandomPyramid();
checkAllSortieLogique();
function reset(){
clearArray(switchs);
clearArray(lineCount);
clearArray(logiques);
console.log(logiques);
clearArray(lines);
clearArray(endLines);
clearArray(switchsInfo);
clearArray(switchsInfoCopy);
clearArray(lineRemove);
timeEnd = 70;
//switch
numberOfSwitch = 0;
//grid
colonneTot = 0;
numberPerColonne = [];
liveColonneNumber = [];
stage = new Konva.Stage({
container: 'play-container',
/*rotation: -90,
x: 20,
y: 1000,*/
width: width,
height: height,
});
layer.destroyChildren();
stage.add(layer);
initLayer();
creatorRandomPyramid();
checkAllSortieLogique();
}
</script>
<script>
var modal = document.getElementById("myModal");
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
fitStageIntoParentContainer();
function fitStageIntoParentContainer() {
if(window.innerWidth < window.innerHeight && mobile == false){
stage.rotate(90);
stage.x(stage.getX() + stage.height());
stage.draw();
mobile=true;
}else if(mobile){
stage.rotate(0);
stage.draw();
mobile=true;
}
var container = document.querySelector('#play-container');
// now we need to fit stage into parent
var containerWidth = container.offsetWidth;
// to do this we need to scale the stage
var scale = containerWidth / width;
stage.width(width * scale);
stage.height(height * scale);
stage.scale({ x: scale, y: scale });
stage.draw();
}
window.addEventListener('resize', fitStageIntoParentContainer);
</script>
</body>
</html>

@ -27,21 +27,43 @@ timer.addEventListener('secondsUpdated', function (e) {
});
function endTime() {
if(!isTuto){
document.querySelector("#mainPage").style.display = 'block';
closeGame();
var score = (niveauActuel * (50 / timeTot)).toFixed(2);
document.querySelector("#playPage").style.display = 'none';
document.querySelector("#scoreTotGameOver").innerHTML = score;
document.querySelector("#niveauGameOver").innerHTML = niveauActuel;
document.querySelector("#TempsTotGameOver").innerHTML = timeTot;
//calcul stars
resetStar();
if(score < 10){
document.querySelector("#star1").style.color = "#fe8a71";
}else if(score > 10 || score < 50){
document.querySelector("#star1").style.color = "#fe8a71";
document.querySelector("#star2").style.color = "#fe8a71";
}else if(score > 10 || score < 50){
}else if(score > 50 || score < 200){
document.querySelector("#star1").style.color = "#fe8a71";
document.querySelector("#star2").style.color = "#fe8a71";
document.querySelector("#star3").style.color = "#fe8a71";
}
else if(score > 200 || score < 400){
document.querySelector("#star1").style.color = "#fe8a71";
document.querySelector("#star2").style.color = "#fe8a71";
document.querySelector("#star3").style.color = "#fe8a71";
document.querySelector("#star4").style.color = "#fe8a71";
}else{
document.querySelector("#star1").style.color = "#fe8a71";
document.querySelector("#star2").style.color = "#fe8a71";
document.querySelector("#star3").style.color = "#fe8a71";
document.querySelector("#star4").style.color = "#fe8a71";
document.querySelector("#star5").style.color = "#fe8a71";
}
openModal('gameOver');
}
}
function resetStar(){
document.querySelector("#star1").style.color = document.body.style.color;
document.querySelector("#star2").style.color = document.body.style.color;
document.querySelector("#star3").style.color = document.body.style.color;
document.querySelector("#star4").style.color = document.body.style.color;
document.querySelector("#star5").style.color = document.body.style.color;
}
Loading…
Cancel
Save