diff --git a/flask/testapp/static/javascript/beautyVote.js b/flask/testapp/static/javascript/beautyVote.js index a1a162c..d6298b6 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; } } diff --git a/flask/testapp/static/javascript/resultScreen.js b/flask/testapp/static/javascript/resultScreen.js index 56b6cd8..cd09afb 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"); @@ -132,6 +146,7 @@ fTextN("Rule Explanation\n\n・Please choose your favorite option\n・If the chosen option is the majority,\nyou get high points!\n・The time limit is 30 seconds\n・No mid-term participation or withdrawal", 480, 950, 230, 35, "black"); } if(player.number == 0){ + setAlp(95); fRect(200, 580, 560, 200, "black"); sRect(200, 580, 560, 200, "blue"); setAlp(100); @@ -144,6 +159,7 @@ if(tapC == 1){ tapC ++; if(200 <= tapX && tapX <= 760 && 580 <= tapY && tapY <= 780){ + fRect(200, 580, 560, 200, "black"); sendStart(); } } @@ -255,13 +271,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