• R/O
  • HTTP
  • SSH
  • HTTPS

GameScriptCoreLibrary: Commit

Javascriptで動作する、ゲームの中核部分を提供するライブラリ


Commit MetaInfo

Revisión249beb46b25bbe3612af234277fd1466ba0c26d5 (tree)
Tiempo2013-09-06 17:26:48
Autorisuke <namahage.toshi@gmai...>
Commiterisuke

Log Message

Cambiar Resumen

Diferencia incremental

--- a/www/corelib/classes/TeleportMachineClass.js
+++ /dev/null
@@ -1,80 +0,0 @@
1-// args[0] : ステージ名を返す関数。nullを指定するとキャンセル
2-
3-var TeleportMachineClass = function(stage, args)
4-{
5- var that = this;
6- this.modalFunc = function(){
7- that.teleporting = true;
8- that.teleportTick = 0;
9- };
10-
11-
12- TeleportMachineClass.base.apply(this, [stage, ["teleport.png", function(){
13- var ret = args[0]();
14- if(ret)
15- {
16- that.ownerStage.manager.pauseStage(that.tick, that.modalFunc);
17- }
18- }]]);
19-
20- this.times = -1;
21- this.touchInterval = 180;
22- this.mustSelectKey = true;
23- this.size.x = 96;
24- this.size.y = 256;
25-
26- this.teleporting = false;
27- this.teleportTick = 0;
28-
29- this.blindHeight = 0;
30-
31- this.tickCount = 0;
32-
33-}.extend(FreeItemClass, {
34- tick:function()
35- {
36- TeleportMachineClass.base.tick.apply(this, []);
37- var mainCharacter = this.ownerStage.userControlledCharacter; //139
38-
39- if(this.teleporting)
40- {
41- if(++this.tickCount < 10) return;
42- this.tickCount = 0;
43- console.log(this.teleportTick);
44- if(this.teleportTick < 42) //テレポートマシンまで上る
45- {
46- mainCharacter.origin.x = this.origin.x + (this.size.x - mainCharacter.size.x) / 2;
47- mainCharacter.origin.y = this.origin.y + this.size.y - mainCharacter.size.y - this.teleportTick;
48- }else if(this.teleportTick < 45) //すこしまつ
49- {
50-
51- }else //振動開始
52- {
53- this.forceTopMost = true;
54- mainCharacter.origin.x = this.origin.x + (this.size.x - mainCharacter.size.x) / 2 + (this.teleportTick % 2 = 0 ? -3 : 3);
55- if(this.teleportTick < 55) //振動したまま待つ
56- {
57- }else if(this.teleportTick < 65) //ブラインドが閉じる
58- {
59- this.blindHeight += 5;
60- }else if(this.teleportTick < 93) //再度待つ
61- {
62- }else
63- {
64- //移動!
65- this.teleporting = false;
66- showAlert(this.ownStage.manager, "移動しました");
67- }
68- }
69-
70- this.teleportTick++;
71- }
72- },
73- draw:function(x, y){
74- TeleportMachineClass.base.prototype.draw.apply(this, [x, y]);
75- this.ownerStage.mainContext.save();
76- this.ownerStage.mainContext.fillStyle = "#4b97f2";
77- this.ownerStage.mainContext.fillRect(0, 215 - this.blindHeight, this.size.x, this.blindHeight);
78- this.ownerStage.mainContext.restore();
79- }
80-});
\ No newline at end of file
--- a/www/corelib/header.js
+++ b/www/corelib/header.js
@@ -31,7 +31,6 @@ document.write("<script type='text/javascript' src='corelib/classes/OperatedChar
3131 document.write("<script type='text/javascript' src='corelib/classes/EnemyCharacterClass.js'></script>");
3232 document.write("<script type='text/javascript' src='corelib/classes/FireObjectClass.js'></script>");
3333 document.write("<script type='text/javascript' src='corelib/classes/BreadItemWidgetClass.js'></script>");
34-document.write("<script type='text/javascript' src='corelib/classes/TeleportMachineClass.js'></script>");
3534 document.write("<script type='text/javascript' src='corelib/classes/TimerWidgetClass.js'></script>");
3635 document.write("<script type='text/javascript' src='corelib/classes/WarpItemClass.js'></script>");
3736 document.write("<script type='text/javascript' src='corelib/classes/EnemyCharacters/EnemyCharacterClass_AntigravitySpine.js'></script>");
--- a/www/monitor.html
+++ b/www/monitor.html
@@ -48,10 +48,17 @@ function tick(){
4848 }
4949 }
5050
51+function rebuild(){
52+ networkManager.sendRequestSync("GET", URL_PCD_Root + "monitor.php?action=rebuild", false, null);
53+}
54+
5155 </script>
5256 </head>
5357 <body>
5458 <h1>pcd2013adminMonitor</h1>
59+ <form onsubmit = "return false;">
60+ <button onclick="rebuild();">rebuild</button>
61+ </form>
5562 <h2>userList</h2>
5663 <h3 id="ts">ServerTime:</h3>
5764 <textarea name="userListText" cols="64" rows="8"></textarea>
--- a/www/monitor.php
+++ b/www/monitor.php
@@ -12,7 +12,54 @@ if (mysqli_connect_error()) {
1212 $db->set_charset("utf8");
1313 //action解釈
1414 if(isset($_GET['action'])){
15-
15+ $action = $_GET['action'];
16+ if(strcmp($action, 'rebuild') == 0){
17+ //すでにあるテーブルの削除
18+ //authUserTable
19+ $stmt = $db->prepare("drop table authUserTable");
20+ $stmt->execute();
21+ //エラーチェック省略
22+ $stmt->close();
23+ //stageObjectTable
24+ $stmt = $db->prepare("drop table stageObjectTable");
25+ $stmt->execute();
26+ //エラーチェック省略
27+ $stmt->close();
28+ //再生成
29+ //authUserTable
30+ $stmt = $db->prepare("
31+create table authUserTable (
32+ id int auto_increment,
33+ name text character set utf8,
34+ lastResponseTimestamp bigint,
35+ userStageName char(64),
36+ userCharacterBaseClass char(64),
37+ index(id)
38+)");
39+ $stmt->execute();
40+ //エラーチェック省略
41+ $stmt->close();
42+ //stageObjectTable
43+ $stmt = $db->prepare("
44+create table stageObjectTable (
45+ id int auto_increment,
46+ locationX double,
47+ locationY double,
48+ velocityX double,
49+ velocityY double,
50+ stageName char(64),
51+ className char(64),
52+ objectAttribute text character set utf8,
53+ constructorArgs text character set utf8,
54+ ownerUserID int,
55+ modifiedTimestamp bigint,
56+ addedTimestamp bigint,
57+ index(id)
58+)");
59+ $stmt->execute();
60+ //エラーチェック省略
61+ $stmt->close();
62+ }
1663 } else{
1764 //action未指定のときはデフォルト動作
1865 //timestamp
Show on old repository browser