1: <html lang="en">
2: <head>
3: <meta charset="utf-8">
4: <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.css" />
5: <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
6: <script src="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js"></script>
7: <title>Let's Go</title>
8: </head>
9: <body>
10: <center>
11: <button onclick="myFunction()">Let's Start the Game!</button>
12: <p id="demo"></p>
13: <script>
14: function myFunction() {
15: var person = prompt("Please enter your name", "Name");
16: if (person != null) {
17: document.getElementById("demo").innerHTML =
18: "Hello " + person + "! Let's Play Game!!!";
19: }
20: }
21: </script>
22: <iframe width="640" height="480" frameborder="0" seamless="seamless" scrolling="no"
23: src="https://plot.ly/~KrittinEddy/42/score.embed?width=640&height=480" ></iframe>
24: </center>
25: </body>
26: </html>
มีส่วนสำคัญสามส่วนคือ ส่วนของ Tag button เป็นส่วนของปุ่มกดเมื่อมการกดปุ่มเริ่มเกมส์ จะให้ทำการป้อนชื่อของผู้ใช้งานก่อน โดยจะทำงานผ่านอีกหนึ่งส่วน คือ function และส่วนสุดท้ายคือส่วนของการแสดงผลเป็นกราฟคะแนนหรือสิถิติพัฒนาการคะแนนของของผู้ใช้งานผ่าน Tag iframe ซึ่งเป็นกราฟที่ดึง Embed มาจาก Plotlyผลการทำงานของโค้ด HTML
ภาพแสดงหน้าเว็บการทำงานหน้าแรก
ภาพแสดง Dialog เมื่อมีการกดปุ่มเพื่อเริ่มเกมจะให้ทำการป้อนชื่อผู้เล่น
ภาพแสดงหน้าจอขณะเล่นเกม
ภาพแสดงหน้าจอเมื่อมีการเล่นเกมตายไปแล้ว 3 ครั้ง
โดยในรอบแรกได้ 0 คะแนน รอบที่ 2 ได้ 3 คะแนน และรอบที่ 3 ได้ 4 คะแนน




ไม่มีความคิดเห็น:
แสดงความคิดเห็น