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