[81] | 1 | <!-- $Id$ --> |
---|
| 2 | |
---|
| 3 | <!DOCTYPE html> |
---|
| 4 | <html lang="ja"> |
---|
| 5 | <head> |
---|
| 6 | <meta charset="UTF-8"></meta> |
---|
| 7 | <title>PyCodeShooter β</title> |
---|
| 8 | <link rel="stylesheet" href="/tdiary.css" type="text/css" media="all" /> |
---|
| 9 | <script type="text/javascript" charset="UTF-8" src="shooter/bullet.js"></script> |
---|
| 10 | <script type="text/javascript" charset="UTF-8" src="shooter/barrage.js"></script> |
---|
| 11 | <script type="text/javascript" charset="UTF-8" src="shooter/action.js"></script> |
---|
| 12 | <script type="text/javascript" charset="UTF-8" src="shooter/trooper.js"></script> |
---|
| 13 | <script type="text/javascript" charset="UTF-8" src="shooter/system.js"></script> |
---|
| 14 | <script type="text/javascript"> |
---|
| 15 | var titleIntervalId = 0; |
---|
| 16 | |
---|
| 17 | function start(id, list) { |
---|
[84] | 18 | var msg = document.getElementById("message"); |
---|
[81] | 19 | var player = { |
---|
| 20 | "name": document.getElementById("name").value, |
---|
| 21 | "size": parseInt(document.getElementById("size").value), |
---|
[97] | 22 | "hitsize": parseInt(document.getElementById("hitsize").value), |
---|
[81] | 23 | "speed": parseInt(document.getElementById("speed").value), |
---|
| 24 | "hitpoint": parseInt(document.getElementById("hitpoint").value), |
---|
| 25 | "shotsize": parseInt(document.getElementById("shotsize").value), |
---|
| 26 | "shotinterval": parseInt(document.getElementById("shotinterval").value), |
---|
| 27 | "shotspeed": parseInt(document.getElementById("shotspeed").value), |
---|
[92] | 28 | "shotlevel": parseInt(document.getElementById("shotlevel").value), |
---|
| 29 | "numbombs": parseInt(document.getElementById("numbombs").value) |
---|
[81] | 30 | }; |
---|
| 31 | |
---|
| 32 | for (var n in player) { |
---|
| 33 | if (n == "name") |
---|
| 34 | continue; |
---|
| 35 | if (!player[n] || player[n] < 0) { |
---|
[84] | 36 | setMessage(msg, "Invalid Input Data"); |
---|
[81] | 37 | return; |
---|
| 38 | } |
---|
| 39 | } |
---|
| 40 | |
---|
[84] | 41 | if (titleIntervalId) { |
---|
| 42 | clearInterval(titleIntervalId); |
---|
| 43 | titleIntervalId = 0; |
---|
| 44 | } |
---|
| 45 | |
---|
[81] | 46 | document.onkeydown = function (ev) { setKeyDown(ev.keyCode); }; |
---|
| 47 | document.onkeyup = function (ev) { setKeyUp(ev.keyCode); }; |
---|
| 48 | document.onkeypress = function (ev) { setKeyPress(ev.charCode); }; |
---|
| 49 | |
---|
[84] | 50 | initGame(document.getElementById("screen"), msg, id, list[id], player); |
---|
[81] | 51 | } |
---|
| 52 | |
---|
| 53 | function initControlPanel(list) { |
---|
| 54 | var cp = document.getElementById("controlpanel"); |
---|
| 55 | var sel = "<select id=\"bossSelection\">"; |
---|
| 56 | |
---|
| 57 | for (var id in list) { |
---|
| 58 | sel += "<option value=\"" + id + "\"" + ">" + list[id].name + "</option>"; |
---|
| 59 | } |
---|
| 60 | |
---|
| 61 | cp.innerHTML = sel + "</select>"; |
---|
| 62 | |
---|
| 63 | document.getElementById("bossSelection").onchange = function (ev) { |
---|
| 64 | start(this[this.selectedIndex].value, list); |
---|
| 65 | }; |
---|
| 66 | } |
---|
| 67 | |
---|
| 68 | window.onload = function () { |
---|
| 69 | var screen = document.getElementById("screen"); |
---|
| 70 | var ctx = screen.getContext("2d"); |
---|
| 71 | var logoimg = document.getElementById("logoimg"); |
---|
| 72 | |
---|
| 73 | var x = (screen.width - logoimg.width) / 2; |
---|
[83] | 74 | var y = -1 - logoimg.height; |
---|
[81] | 75 | var titlePos = screen.height / 2 - logoimg.height / 2; |
---|
| 76 | titleIntervalId = setInterval(function() { |
---|
| 77 | drawScreen(ctx, "source-over", "rgba(8,8,8,0.5)", screen.width, screen.height); |
---|
| 78 | updateBackground(ctx, screen.width, screen.height, 1, "#AAF", 10); |
---|
| 79 | ctx.drawImage(logoimg, x, y); |
---|
| 80 | |
---|
| 81 | if (++y > titlePos) |
---|
| 82 | y = titlePos; |
---|
| 83 | }, 20); |
---|
| 84 | |
---|
| 85 | var req = new XMLHttpRequest(); |
---|
| 86 | req.open("GET", document.getElementById("api").value, false); |
---|
| 87 | req.send(null); |
---|
| 88 | |
---|
| 89 | initControlPanel(JSON.parse(req.responseText).result); |
---|
| 90 | }; |
---|
| 91 | </script> |
---|
| 92 | </head> |
---|
| 93 | |
---|
| 94 | <body> |
---|
| 95 | <h1 class="title">PyCodeShooter β</h1> |
---|
| 96 | |
---|
| 97 | <div class="main"> |
---|
| 98 | <div style="margin-left: 5em; margin-right: 5em; font-style: italic;"> |
---|
| 99 | <p>Pythonista éã®ææŠã«ïŒ</p> |
---|
| 100 | <p style="text-align: right;">åã¯ïŒèããããã...</p> |
---|
| 101 | </div> |
---|
| 102 | |
---|
| 103 | <div class="day"> |
---|
| 104 | <h2><span class="title">PyCodeShooter β</span></h2> |
---|
| 105 | <div class="body"> |
---|
| 106 | <div class="section"> |
---|
| 107 | <form> |
---|
| 108 | <h3><span class="sanchor">â </span> ææŠãã!</h3> |
---|
| 109 | <p id="controlpanel">Now loading...</p> |
---|
| 110 | <p> |
---|
| 111 | åå: <input type="text" value="Player" size="8" id="name" /> |
---|
| 112 | èä¹
æ§: <input type="text" value="15" size="3" id="hitpoint" /> |
---|
[92] | 113 | ãã æ°: <input type="text" value="2" size="3" id="numbombs" /> |
---|
[81] | 114 | <br /> |
---|
| 115 | <canvas id="screen" width="320" height="480"></canvas> |
---|
[97] | 116 | <input type="hidden" value="7" id="size" /> |
---|
| 117 | <input type="hidden" value="1" id="hitsize" /> |
---|
[81] | 118 | <input type="hidden" value="5" id="speed" /> |
---|
| 119 | <input type="hidden" value="7" id="shotsize" /> |
---|
| 120 | <input type="hidden" value="5" id="shotspeed" /> |
---|
| 121 | <input type="hidden" value="10" id="shotinterval" /> |
---|
| 122 | <input type="hidden" value="3" id="shotlevel" /> |
---|
| 123 | <input type="hidden" value="/etc/pycodebattler/?mode=json" id="api" /> |
---|
| 124 | <img src="logo.png" style="visibility: hidden;" id="logoimg" /> |
---|
| 125 | </p> |
---|
| 126 | </form> |
---|
| 127 | </div> |
---|
| 128 | </div> |
---|
| 129 | </div> |
---|
| 130 | </div> |
---|
| 131 | |
---|
| 132 | <div class="sidebar"> |
---|
| 133 | <div style="margin: 1em;"> |
---|
| 134 | <p>ããã¯äœ?</p> |
---|
| 135 | <ul style="font-size: small;"> |
---|
| 136 | <li><a href="/etc/pycodebattler/">PyCodeBattler</a> ã«ç»é²ããã Python ã³ãŒããšæŠããŸã</li> |
---|
| 137 | </ul> |
---|
| 138 | |
---|
| 139 | <p>æäœ</p> |
---|
| 140 | <dl style="font-size: small;"> |
---|
| 141 | <dt>â ã·ã§ãã:</dt> |
---|
| 142 | <dd>z</dd> |
---|
[92] | 143 | <dt>â ãã :</dt> |
---|
| 144 | <dd>a</dd> |
---|
[81] | 145 | <dt>â 移åé床é
延:</dt> |
---|
| 146 | <dd>x</dd> |
---|
| 147 | <dt>â 匟åæ¿:</dt> |
---|
| 148 | <dd>c</dd> |
---|
| 149 | <dt>â 巊移å:</dt> |
---|
| 150 | <dd>â or h</dd> |
---|
| 151 | <dt>â äžç§»å:</dt> |
---|
| 152 | <dd>â or j</dd> |
---|
| 153 | <dt>â äžç§»å:</dt> |
---|
| 154 | <dd>â or k</dd> |
---|
| 155 | <dt>â å³ç§»å:</dt> |
---|
| 156 | <dd>â or l</dd> |
---|
| 157 | </dl> |
---|
| 158 | |
---|
| 159 | <p>ã·ã¹ãã ã¡ãã»ãŒãž</p> |
---|
| 160 | <span id="message" style="font-size: small;"><br /></span> |
---|
| 161 | |
---|
| 162 | <p>泚æ</p> |
---|
| 163 | <ul style="font-size: small;"> |
---|
| 164 | <li>ãã©ã¡ãŒã¿ç調æŽäžã«ã€ãïŒãã£ã©ã®åŒ·ãã匟å¹çãå€ãã£ããããå¯èœæ§ããããŸã</li> |
---|
| 165 | <li>Chrome æšå¥šã§ãïŒFirefox ã ãšéãïŒIE ã ãšå€ååããŸãã</li> |
---|
| 166 | </ul> |
---|
| 167 | |
---|
| 168 | <p>TODO</p> |
---|
| 169 | <ul style="font-size: small;"> |
---|
| 170 | <li>åäœãã¿ãŒã³ãå¢ãã</li> |
---|
| 171 | <li>匟å¹ãã¿ãŒã³ãå¢ãã</li> |
---|
[93] | 172 | <li>ãã 衚瀺</li> |
---|
[81] | 173 | <li>ã¹ã³ã¢ãªã³ã°</li> |
---|
| 174 | <li>ãã¯ãŒã¢ããã¢ã€ãã </li> |
---|
| 175 | <li>æµ/èªæ©ã«ç»åãšã</li> |
---|
| 176 | <li>ã¡ãã¥ãŒãäœãšããã</li> |
---|
[95] | 177 | <li>ãã¡ãŒãžæåäœãåã</li> |
---|
[81] | 178 | </ul> |
---|
| 179 | |
---|
| 180 | <p>ãœãŒã¹ã³ãŒã</p> |
---|
| 181 | <ul style="font-size: small;"> |
---|
| 182 | <li><a href="http://trac.atzm.org/index.cgi/browser/pycodeshooter">pycodeshooter</a></li> |
---|
| 183 | </ul> |
---|
| 184 | </div> |
---|
| 185 | </div> |
---|
| 186 | </body> |
---|
| 187 | </html> |
---|