diff --git a/flask/testapp/static/javascript/beautyVote.js b/flask/testapp/static/javascript/beautyVote.js index 78b7d89..6a6e57e 100644 --- a/flask/testapp/static/javascript/beautyVote.js +++ b/flask/testapp/static/javascript/beautyVote.js @@ -28,13 +28,11 @@ } - - - class Player{ constructor(){ this.points = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1]; this.choice = 0; + this.name = 0; } calcScore(){ var score = 0; @@ -61,6 +59,36 @@ switch(scene){ case 3: + fill("silver"); + setAlp(50); + + fRect(50, 50, 855, 100, "black"); + fText("美人投票ゲーム", 480, 100, 80, "white"); + fText("あなたの名前を入力してください", 480, 200, 50, "black"); + + fRect(200, 500, 560, 200, "black"); + sRect(200, 500, 560, 200, "blue"); + setAlp(100); + fText("ゲーム開始!", 480, 600, 50, "white"); + + setAlp(20); + fRect(100, 800, 760, 300, "black"); + setAlp(100); + fTextN("ルール1\nルール2\nルール3\nルール4", 480, 950, 200, 50, "white"); + + + if(tapC == 1){ + tapC ++; + + if(200 <= tapX && tapX <= 760 && 500 <= tapY && tapY <= 700){ + player.name = document.getElementById('textBox').value; + document.getElementById('textBox').style.display = 'none'; + scene = 1; + } + } + + + break; case 1: if(timer < 900){ @@ -86,6 +114,7 @@ fText("B.", 550, 425, 40, "white"); fText("C.", 100, 725, 40, "white"); fText("D.", 550, 725, 40, "white"); + fText(player.name, 50, 50, 40, "white"); fText(question[round].question, 480, 100, 30, "white"); fText(question[round].choiceA, 275, 425, 25, "white"); @@ -110,10 +139,6 @@ } } - if(round >= MAX_ROUND){ - fText("あなたのスコアは" + player.calcScore() + "点です", 480, 600, 80, "gold"); - } - if(tapC == 1){ tapC ++; @@ -126,6 +151,7 @@ player.choice = B; postForm(player.choice) // 送信用 checkAnswer(); + //document.getElementById('textBox').style.display = 'block'; } else if(50 <= tapX && tapX <= 450 && 600 <= tapY && tapY <= 850){ player.choice = C; @@ -209,7 +235,7 @@ var CORRECT = 1; var WRONG = 0; -var scene = 1; +var scene = 3; var BLOCK_SIZE = 5; var my_order = 8; diff --git a/flask/testapp/static/javascript/resultScreen.js b/flask/testapp/static/javascript/resultScreen.js index 3e33aed..682ac7e 100644 --- a/flask/testapp/static/javascript/resultScreen.js +++ b/flask/testapp/static/javascript/resultScreen.js @@ -12,7 +12,9 @@ setAlp(50); fRect(50, 50, 855, 100, "black"); fText("結果発表 ", 480, 100, 80, "white"); - fText("あなたの順位は...", 230, 200, 50, "black"); + fText(player.name+"さんのスコアは" + player.calcScore() + "点です!", 480, 200, 50, "gold"); + + //fText("あなたの順位は...", 230, 200, 50, "black"); fText(my_order+"位!", 480, 300, 110, "red"); fRect(45, 370, 865, 700, "white"); fText("成績上位者", 300, 410, 50, "black"); @@ -38,4 +40,8 @@ } +} + +function inputName(){ + } \ No newline at end of file diff --git a/flask/testapp/templates/testapp/index.html b/flask/testapp/templates/testapp/index.html index dd0b9db..fb09098 100644 --- a/flask/testapp/templates/testapp/index.html +++ b/flask/testapp/templates/testapp/index.html @@ -11,6 +11,7 @@
+ @@ -23,6 +24,24 @@ + + +