Skip to content

Commit

Permalink
final-proto
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalbes committed Jan 23, 2020
1 parent 866033d commit 6f50de4
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 35 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Ressources/Plan Paris/pin-8-64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Ressources/Plan Paris/pin-9-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 3 additions & 16 deletions code.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

//Définition des paramêtres principaux du jeu

var nbAudios = 2 //nombre d'audios proposés
var nbPics = 2 //nombre d'images proposées
var nbMaps = 18 //nombre de maps proposées
var nbAudios = 4 //nombre d'audios proposés
var nbPics = 4 //nombre d'images proposées
var nbMaps = 4 //nombre de maps proposées

var maxScore=(nbAudios+nbPics+nbMaps)*7000;

Expand Down Expand Up @@ -44,9 +44,6 @@ gamePlan.push(loadResults);
// var gamePlan=[loadMapGame, nextMap]


console.log(gamePlan);


//LANCEMENT DU JEU

nextPart("firstPart");
Expand Down Expand Up @@ -79,8 +76,6 @@ function loadResults() {
gameInfoDiv.style.visibility="hidden"
gameInfoDiv.style.position="fixed"

console.log(totalScore, Number(scoreElem.textContent), maxScore)

//commentaires
if (Number(scoreElem.textContent)/maxScore < 0.5) {
document.getElementById("result-text").innerHTML="Seriously ?!"
Expand Down Expand Up @@ -119,8 +114,6 @@ function loadResults() {
tr.appendChild(td3)
}

console.log(titlesArr, nbScoresArr,scoresArr)

scoresArr.forEach((v,i) => {
addLine3(titlesArr[i], nbScoresArr[i],scoresArr[i])
});
Expand Down Expand Up @@ -349,8 +342,6 @@ function loadPicGame() {
//MUSIC GAME
function nextTitle(type) {

console.log("next title-----------------")

timer=0;
var score = 0;
var bonus = 0;
Expand Down Expand Up @@ -409,8 +400,6 @@ function nextTitle(type) {
//gestion des entrées
inputAudio.onchange = function() {

console.log("input value",inputAudio.value)

if (audios[indexAudios].isTheGoodOne(inputAudio.value)) {//entrée ok !

var finalTime= timer;
Expand Down Expand Up @@ -440,8 +429,6 @@ function nextTitle(type) {
}
else {//entrée nok !

console.log("entrée nok")

//volonté de skipper ?
if (inputAudio.value === "pass") {
clearInterval(intervalID);
Expand Down
27 changes: 13 additions & 14 deletions data.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,7 @@ class Picture {
var picsElements=document.getElementsByClassName("pics-element")

for(let i=0;i<4;i++) {
picsElements[i].classList.remove("flip-in-ver-left");
picsElements[i].src=this.files[i]
picsElements[i].classList.add("flip-in-ver-left");
console.log(picsElements[i])
}
}

Expand Down Expand Up @@ -171,7 +168,6 @@ class Audio {

stopMusic() {
let audioElem=document.getElementById("audio");
console.log("yes")
audioElem.pause();
}
}
Expand Down Expand Up @@ -276,7 +272,6 @@ function updateScore(type,result,t) {
nbScoresArr[4]++
}
else if (type==="music" && result===-0.5) { //cas entrée nok
console.log("bad")
bad = -500;
}

Expand Down Expand Up @@ -309,8 +304,6 @@ function updateScore(type,result,t) {
bad!==0 ? nbScoresArr[2]++ : 1
elapsed!==0 ? nbScoresArr[3]++ : 1

console.log([score, bonus, bad, elapsed, penalties])

return [score, bonus, bad, elapsed, penalties]
}

Expand All @@ -327,8 +320,6 @@ function recap(typeGame, typeResult, time, [score, bonus, bad, elapsed, penaltie

totalScore = score+bonus+bad+elapsed+penalties;

console.log(scoresArr, nbScoresArr)

//arrêt de l'audio en cours
if (typeGame==="music") {
audios[0].stopMusic();
Expand Down Expand Up @@ -370,16 +361,24 @@ function recap(typeGame, typeResult, time, [score, bonus, bad, elapsed, penaltie

//bonne ou mauvaise réponse
if (bonus >0) {
var mapInfo = ""
if (typeGame==="map") {
mapInfo = "<br>" + "You are " + typeResult + " meters away";
}
document.getElementById("recap-text").innerHTML="Well done !" + mapInfo
document.getElementById("recap-text").innerHTML="Well done!"
}
else {
document.getElementById("recap-text").innerHTML="Too bad!"
}

//Réponse
if (typeGame==="music") {
document.getElementById("recap-answer").innerHTML="Expected answer was:<br>\"" + elemClicked + "\""
}
else if (typeGame==="pics") {
document.getElementById("recap-answer").innerHTML="The picture you selected is:<br>\"" + elemClicked + "\""
}
else if (typeGame==="map") {
document.getElementById("recap-answer").innerHTML="You are " + typeResult + " meters away";
}


//Score total
document.getElementById("recap-score").innerHTML=totalScore + " pts"

Expand Down
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ <h1 id="score">0</h1>

<div id="recap">
<p id="recap-text"></p>

<p id="recap-answer"></p>

<span id="recap-score"></span>

Expand Down
2 changes: 1 addition & 1 deletion map.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<div id="image-div">
<div id="image-div" class="pin-cursor">
<img src="./Ressources/Plan Paris/shutterstock_511329829 - cut.jpg" id="map-image">
</div>

Expand Down
21 changes: 17 additions & 4 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -114,23 +114,33 @@ body {


#recap-text {
font-family: 'Parisienne', cursive;
font-family: "Montserrat", sans-serif;
text-align: center;
border: none;
left: 0;
right: 0;
margin: 3vh auto;
margin: 2vh auto;
font-size: 40px;
}

#recap-answer {
font-family: 'Parisienne', cursive;
text-align: center;
border: none;
left: 0;
right: 0;
margin: 0 auto;
font-size: 25px;
}

#recap-score {
text-align: center;
border: none;
height: fit-content;
padding: 10px 30px;
left: 0;
right: 0;
margin: 1vh auto 1vh;
margin: 4vh auto 2vh;
font-family: "Montserrat", sans-serif;
font-size: 30px;
font-weight: bold;
Expand All @@ -140,7 +150,7 @@ body {
}

#recap-table{
margin: 2vh auto 5vh;
margin: 0vh auto 5vh;
width: 25vw;
text-align: center;
font-family: "Montserrat Light", sans-serif;
Expand Down Expand Up @@ -479,6 +489,9 @@ h4 {
object-fit: cover;
}

.pin-cursor {
cursor: url('./Ressources/Plan Paris/pin-8-64.png'), auto;
}

/*
#image-div {
Expand Down

0 comments on commit 6f50de4

Please sign in to comment.