diff --git a/flask/testapp/static/javascript/beautyVote.js b/flask/testapp/static/javascript/beautyVote.js index f66ef00..7985cce 100644 --- a/flask/testapp/static/javascript/beautyVote.js +++ b/flask/testapp/static/javascript/beautyVote.js @@ -23,7 +23,7 @@ class Player{ constructor(){ this.points = Array(MAX_ROUND).fill(0); - this.choice = 0; + this.choice = E; this.score = 0; this.name = 0; this.number = 0; @@ -117,6 +117,7 @@ if(round < MAX_ROUND){ setQuestion(round); scene = GAME_SCENE; + player.choice = E; } else{ scene = WAIT_RESULT; @@ -135,45 +136,45 @@ //結果表示 case RESULT_SCENE: - showResult(); - if(tapC == 1){ - tapC ++; - if(80 <= tapX && tapX <= 180 && 1080 <= tapY && tapY <= 1130){ - console.log("show result") - break; - } - else{ - for(var i = 0; i < MAX_ROUND; i ++){ - if(450 + 50*i < tapX && tapX < 450 + 50*i + 50 && 1080 < tapY && tapY < 1130){ - console.log("show round"+i) - showOtherResult(i) - view_result = i - scene = CHECK_RESULT - } - } - } - } + // showResult(); + // if(tapC == 1){ + // tapC ++; + // if(80 <= tapX && tapX <= 180 && 1080 <= tapY && tapY <= 1130){ + // console.log("show result") + // break; + // } + // else{ + // for(var i = 0; i < MAX_ROUND; i ++){ + // if(450 + 50*i < tapX && tapX < 450 + 50*i + 50 && 1080 < tapY && tapY < 1130){ + // console.log("show round"+i) + // showOtherResult(i) + // view_result = i + // scene = CHECK_RESULT + // } + // } + // } + // } break; case CHECK_RESULT: - showOtherResult(view_result); - if(tapC == 1){ - tapC ++; - if(80 <= tapX && tapX <= 180 && 1080 <= tapY && tapY <= 1130){ - showResult(); - console.log("show result") - scene = RESULT_SCENE; - } - else{ - for(var i = 0; i < MAX_ROUND; i ++){ - if(450 + 50*i <= tapX && tapX <= 450 + 50*i + 50 && 1080 <= tapY && tapY <= 1130){ - showOtherResult(i) - console.log("show round"+(i+1)) - view_result = i - } - } - } - } + // showOtherResult(view_result); + // if(tapC == 1){ + // tapC ++; + // if(80 <= tapX && tapX <= 180 && 1080 <= tapY && tapY <= 1130){ + // showResult(); + // console.log("show result") + // scene = RESULT_SCENE; + // } + // else{ + // for(var i = 0; i < MAX_ROUND; i ++){ + // if(450 + 50*i <= tapX && tapX <= 450 + 50*i + 50 && 1080 <= tapY && tapY <= 1130){ + // showOtherResult(i) + // console.log("show round"+(i+1)) + // view_result = i + // } + // } + // } + // } break; } } @@ -366,8 +367,8 @@ var xhr = new XMLHttpRequest(); var result_xhr= new XMLHttpRequest(); -var round = 10; //変更 -var MAX_ROUND = 1; +var round = 0; //変更 +var MAX_ROUND = 10; var CHOICE_NUMBER = 5; var max_player = 0; // 最大のplayer数(変更不要) var current_player = 0; diff --git a/flask/testapp/static/javascript/resultScreen.js b/flask/testapp/static/javascript/resultScreen.js index ffdfe49..6b0a47f 100644 --- a/flask/testapp/static/javascript/resultScreen.js +++ b/flask/testapp/static/javascript/resultScreen.js @@ -1,13 +1,28 @@ function showQuestion(){ fill("silver"); - setAlp(50); + setAlp(45); fRect(50, 50, 855, 100, "black"); fRect(45, 295, 860, 560, "white"); fRect(50, 300, 400, 250, "black"); fRect(500, 300, 400, 250, "black"); fRect(50, 600, 400, 250, "black"); fRect(500, 600, 400, 250, "black"); - + if (player.choice == A){ + setAlp(50); + fRect(50, 300, 400, 250, "black"); + } + else if (player.choice == B){ + setAlp(50); + fRect(500, 300, 400, 250, "black"); + } + else if (player.choice == C){ + setAlp(50); + fRect(50, 600, 400, 250, "black"); + } + else if (player.choice == D){ + setAlp(50); + fRect(500, 600, 400, 250, "black"); + } setAlp(100); fText("Q.", 110, 100, 40, "white"); @@ -31,7 +46,6 @@ fText("ROUND " + (round+1), 150, 1000, 50, "red"); fText("Current Points: " + player.score + " Pt", 650, 1000, 50, "black"); } - if(scene == GAME_SCENE){ setAlp(50); sRect(45, 880, 865, 40, "black"); @@ -40,14 +54,14 @@ fText(int(timer/30), 900, 1100, 50, "red"); } if(scene == ROUND_RESULT){ - fText(CheckPeople(A, round) +"人", 275, 425, 50, "black"); - fText(checkOrder(A, round) + "Pt", 400, 500, 50, "black"); - fText(CheckPeople(B, round)+"人", 725, 425, 50, "black"); - fText(checkOrder(B, round) + "Pt", 850, 500, 50, "black"); - fText(CheckPeople(C, round)+"人", 275, 725, 50, "black"); - fText(checkOrder(C, round) + "Pt", 400, 800, 50, "black"); - fText(CheckPeople(D, round)+"人", 725, 725, 50, "black"); - fText(checkOrder(D, round) + "Pt", 850, 800, 50, "black"); + fText(CheckPeople(A, round) +"人", 275, 500, 50, "#B20000"); + fText(checkOrder(A, round) + "Pt", 400, 500, 50, "#B20000"); + fText(CheckPeople(B, round)+"人", 725, 500, 50, "#B20000"); + fText(checkOrder(B, round) + "Pt", 850, 500, 50, "#B20000"); + fText(CheckPeople(C, round)+"人", 275, 800, 50, "#B20000"); + fText(checkOrder(C, round) + "Pt", 400, 800, 50, "#B20000"); + fText(CheckPeople(D, round)+"人", 725, 800, 50, "#B20000"); + fText(checkOrder(D, round) + "Pt", 850, 800, 50, "#B20000"); } if(scene == WAIT_SCENE){ setAlp(50); @@ -123,6 +137,7 @@ fTextN("Please Wait until\n All Participants are Present...", 480, 500, 50, 50, "red"); } if(player.number == 0){ + setAlp(95); fRect(200, 580, 560, 200, "black"); sRect(200, 580, 560, 200, "blue"); setAlp(100); @@ -135,6 +150,7 @@ if(tapC == 1){ tapC ++; if(200 <= tapX && tapX <= 760 && 580 <= tapY && tapY <= 780){ + fRect(200, 580, 560, 200, "black"); sendStart(); } } @@ -251,13 +267,13 @@ fText(question[show_click_round].choiceC, 275, 725, 25, "white"); fText(question[show_click_round].choiceD, 725, 725, 25, "white"); - fText(CheckPeople(A, show_click_round) +"人", 275, 425, 50, "black"); + fText(CheckPeople(A, show_click_round) +"人", 275, 425, 50, "yellow"); fText(checkOrder(A, show_click_round) + "Pt", 400, 500, 50, "black"); - fText(CheckPeople(B, show_click_round)+"人", 725, 425, 50, "black"); + fText(CheckPeople(B, show_click_round)+"人", 725, 425, 50, "yellow"); fText(checkOrder(B, show_click_round) + "Pt", 850, 500, 50, "black"); - fText(CheckPeople(C, show_click_round)+"人", 275, 725, 50, "black"); + fText(CheckPeople(C, show_click_round)+"人", 275, 725, 50, "yellow"); fText(checkOrder(C, show_click_round) + "Pt", 400, 800, 50, "black"); - fText(CheckPeople(D, show_click_round)+"人", 725, 725, 50, "black"); + fText(CheckPeople(D, show_click_round)+"人", 725, 725, 50, "yellow"); fText(checkOrder(D, show_click_round) + "Pt", 850, 800, 50, "black"); fText("結果", 100, 1100, 50, "black"); diff --git a/flask/testapp/templates/testapp/showResultJPN.html b/flask/testapp/templates/testapp/showResultJPN.html index c399031..59e1632 100644 --- a/flask/testapp/templates/testapp/showResultJPN.html +++ b/flask/testapp/templates/testapp/showResultJPN.html @@ -50,8 +50,8 @@

美人投票ゲーム結果発表

-

あなたのスコアは

-

0pt

+

あなたのスコアは

+

0pt