OSDN Git Service

Merge branch 'master' of https://scm.sourceforge.jp/gitroot/h58pcdgame/GameScriptCore...
[h58pcdgame/GameScriptCoreLibrary.git] / www / stage / main.js
1
2 // StageObjectsはステージに文字シンボルとして配置したいオブジェクト定義の連想配列である。
3 // StageObjectの各項目の指定方法は以下の二通りある。
4 // ・クラス名指定 ... コンストラクタがに引数が不要な時
5 // a : BlockClass
6 // ・拡張指定
7 // a : {base : FreeItemClass,                   //鋳型となるクラス名
8 //      args : '1190.png',                              //コンストラクタに指定する引数(一つだけの場合) stageは自動で指定されるので不要
9 //      args : ['1190.png', callback],  //二つ以上の場合。やはり第一引数のstageは不要
10 //      prop : {times : 1},                             //各インスタンスに指定したいプロパティの連想配列。(省略可)
11                                                                                 //この例ではaFreeItemClass.timesプロパティを1に指定している
12 //      adjust : [-50, 50],                             //位置の微調整。必ずX座標、Y座標の相対位置を示す配列にする。(省略可)
13 //      extid : 19                                              //ネットワークを超えて一つのオブジェクトである必要がある場合にはゼロではない値を取る(ステージ内で固有の値, 省略可; 既定0)
14 //              sync : true                                             //ネットワーク同期を有効に(addStageObjectの第二引数)(省略可; 既定false)
15
16 var stgObjects = {
17         
18         // BlockClass : 普通のブロック。 引数に画像名を指定
19   
20     b : {base:BlockClass,args:'1150.png'},
21     f : {base:BlockClass,args:'1190.png'},
22     t : {base:BlockClass,args:'1160.png'},
23    x : {base:BlockClass,args:'1236.png'},
24     j : {base:BlockClass,args:'1238.png'},
25     y : {base:BlockClass,args:'1240.png'},
26     h : {base:BlockClass,args:'1239.png'},
27   ab: {base:BlockClass,args:'bridge.png'},
28   
29     
30   
31     i : {base:BlockClass,args:'1235.png'},
32     n : {base:BlockClass,args:'leaves.png'},
33     p : {base:BlockClass,args:'glass.png'},
34     ag : {base:BlockClass,args:'hosikusabelow.png'},
35     r : {base:HiddenBlockClass,args:'hosikusa.png'},
36   
37
38    
39     
40     // SlopeBlockClass : 当たり判定が斜めのブロック。
41     // 引数 : 画像名, 当たり判定領域左側の開始位置のブロック上辺からの高さ, 当たり判定領域右側の...
42     //        たとえば、この例のように 0, 32 と指定すれば右下がりの坂になり、32, 0と指定すれば左下がり、 16, 16と指定すれば半分の高さの長方形になる
43     // enableBlockMode : 当たり判定領域をデバッグ表示する。
44  
45     c : {base:SlopeBlockClass,args:['1152.png',32,0],prop:{enableDebugMode:true}},
46     d : {base:SlopeBlockClass,args:['1213.png',16,16],prop:{enableDebugMode:true}},
47     a : {base:SlopeBlockClass,args:['kusa.png',64,64],prop:{enableDebugMode:true}},
48     g : {base:SlopeBlockClass,args:['1151.png',0,32],prop:{enableDebugMode:true}},
49     e : {base:SlopeBlockClass,args:['1214.png',128,128],prop:{enableDebugMode:true}},
50     l : {base:SlopeBlockClass,args:['leavesedge1.png',16,0],prop:{enableDebugMode:true}},
51     m : {base:SlopeBlockClass,args:['leavesedge2.png',0,16],prop:{enableDebugMode:true}},
52     o : {base:SlopeBlockClass,args:['stop.png',32,32],prop:{enableDebugMode:true}},
53     q : {base:SlopeBlockClass,args:['hosikusa.png',8,8],prop:{enableDebugMode:true}},
54     s : {base:SlopeBlockClass,args:['leaves.png',1500,1500],prop:{enableDebugMode:true}},
55     u : {base:SlopeBlockClass,args:['1162.png',32,0],prop:{enableDebugMode:true}},
56     w : {base:SlopeBlockClass,args:['1161.png',0,32],prop:{enableDebugMode:true}},
57     z : {base:SlopeBlockClass,args:['1164.png',32,0],prop:{enableDebugMode:true}},
58    aa : {base:SlopeBlockClass,args:['fence.png',600,600],prop:{enableDebugMode:true}},
59    ad : {base:SlopeBlockClass,args:['fence.png',16,16],prop:{enableDebugMode:true}},
60    ae : {base:SlopeBlockClass,args:['toge.png',28,28],prop:{enableDebugMode:true}},
61    af : {base:SlopeBlockClass,args:['toge.png',0,0],prop:{enableDebugMode:true}},
62
63     // FreeItemClass : キャラが取得するとコールバックが実行されるアイテム
64     // callback : 誰かに取得されたときに発生するコールバック。アタックした人、そのアタック直後のx, y座標が引数にセットされる。
65     // times : 取得できる回数で、-1で無限。
66     k : {base:FreeItemClass,args:["1234.png",callBack],prop:{times:1}},
67     
68     ac : {base:FreeItemClass,args:["bridge.png",callBack],prop:{times:1}},
69     // 何もブロックを置かない位置のためにかならずこのようなエントリーを記述
70     _ : null
71 };
72
73 // FreeItemClassのコールバック
74 function callBack(obj, obj_x, obj_y)
75 {
76         if(obj instanceof MainCharacterClass){
77
78         }
79 }
80
81 var stgInfo = {
82     width: 6400,                                //横サイズ
83     height: 480,                                //縦サイズ
84     background: "back2.png",            //背景画像。横幅は640pxである必要はない。
85     BGM: "S02.mp3",
86 };
87
88 with(stgObjects) {
89     var tbl = [
90          [_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,],
91          [_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,],
92          [_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,],
93          [_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,],
94          [_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,r,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,i,_,_,_,i,i],
95          [_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_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b,b,b,b,],
104          [f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,j,_,_,_,_,_,_,_,_,_,_,_,_,h,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,]
105  
106     ];
107 }
108 //約束事
109 var stage = new PCDSLStageClass(stgInfo, tbl);
110
111
112 stage.runStage = function(){
113         PCDSLStageClass.prototype.runStage.apply(this, []);
114         var main = new MainCharacterClass(stage, [["nakedman.png","nakedman2.png",]]);
115         main.size.x = 32;
116         main.size.y=64;
117         main.origin.x =32;
118         main.origin.y =0;
119         main.ownerUID = stage.manager.userID;
120         main.movingVelocity = 200;
121
122         stage.userControlledCharacter = main;
123         stage.addStageObject(main, true);
124
125 var barn = new SlopeBlockClass(stage, ["barn.png", 49, 49]);
126
127 barn.size.x = 200;
128 barn.size.y = 150;
129 barn.origin.x = 1300;
130 barn.origin.y =236;
131 stage.addStageObject(barn);
132
133 var barn2 = new SlopeBlockClass(stage, ["barn.png", 49, 49]);
134
135 barn2.size.x = 170;
136 barn2.size.y = 150;
137 barn2.origin.x = 3700;
138 barn2.origin.y =266;
139 stage.addStageObject(barn2);
140
141 var windmill = new SlopeBlockClass(stage, ["windmill.png", 5, 5]);
142 windmill.size.x = 50;
143 windmill.size.y = 150;
144 windmill.origin.x = 1600;
145 windmill.origin.y =236;
146 stage.addStageObject(windmill);
147
148
149 var cow2 = new SlopeBlockClass(stage, ["cow2.png", 49, 49]);
150 cow2.size.x = 100;
151 cow2.size.y = 50;
152 cow2.origin.x = 850;
153 cow2.origin.y = 336;
154 stage.addStageObject(cow2);
155
156 var cow3 = new SlopeBlockClass(stage, ["cow.png", 49, 49]);
157 cow3.size.x = 100;
158 cow3.size.y = 50;
159 cow3.origin.x = 930;
160 cow3.origin.y = 336;
161 stage.addStageObject(cow3);
162
163 var fence = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
164 fence.size.x = 32;
165 fence.size.y = 32;
166 fence.origin.x = 736;
167 fence.origin.y = 352;
168 stage.addStageObject(fence);
169
170 var fence2 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
171 fence2.size.x = 32;
172 fence2.size.y = 32;
173 fence2.origin.x = 768;
174 fence2.origin.y = 352;
175 stage.addStageObject(fence2);
176
177 var fence3 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
178 fence3.size.x = 32;
179 fence3.size.y = 32;
180 fence3.origin.x = 800;
181 fence3.origin.y = 352;
182 stage.addStageObject(fence3);
183
184 var fence4 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
185 fence4.size.x = 32;
186 fence4.size.y = 32;
187 fence4.origin.x = 832;
188 fence4.origin.y = 352;
189 stage.addStageObject(fence4);
190
191 var fence5 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
192 fence5.size.x = 32;
193 fence5.size.y = 32;
194 fence5.origin.x = 864;
195 fence5.origin.y = 352;
196 stage.addStageObject(fence5);
197
198 var fence6 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
199 fence6.size.x = 32;
200 fence6.size.y = 32;
201 fence6.origin.x = 896;
202 fence6.origin.y = 352;
203 stage.addStageObject(fence6);
204
205 var fence7 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
206 fence7.size.x = 32;
207 fence7.size.y = 32;
208 fence7.origin.x = 928;
209 fence7.origin.y = 352;
210 stage.addStageObject(fence7);
211
212 var fence8 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
213 fence8.size.x = 32;
214 fence8.size.y = 32;
215 fence8.origin.x = 960;
216 fence8.origin.y = 352;
217 stage.addStageObject(fence8);
218
219 var fence9 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
220 fence9.size.x = 32;
221 fence9.size.y = 32;
222 fence9.origin.x = 992;
223 fence9.origin.y = 352;
224 stage.addStageObject(fence9);
225
226 var fence10 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
227 fence10.size.x = 32;
228 fence10.size.y = 32;
229 fence10.origin.x = 1024;
230 fence10.origin.y = 352;
231 stage.addStageObject(fence10);
232
233 var fence11 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
234 fence11.size.x = 32;
235 fence11.size.y = 32;
236 fence11.origin.x = 3712;
237 fence11.origin.y = 384;
238 stage.addStageObject(fence11);
239
240 var fence12 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
241 fence12.size.x = 32;
242 fence12.size.y = 32;
243 fence12.origin.x = 3680;
244 fence12.origin.y = 384;
245 stage.addStageObject(fence12);
246
247 var cow4 = new SlopeBlockClass(stage, ["cow.png", 14, 14]);
248 cow4.size.x = 100;
249 cow4.size.y = 50;
250 cow4.origin.x = 4010;
251 cow4.origin.y = 367;
252 stage.addStageObject(cow4);
253
254 var cow5 = new SlopeBlockClass(stage, ["cow2.png", 14, 14]);
255 cow5.size.x = 100;
256 cow5.size.y = 50;
257 cow5.origin.x = 4180;
258 cow5.origin.y = 367;
259 stage.addStageObject(cow5);
260
261 var cow6 = new SlopeBlockClass(stage, ["cow.png", 70, 70]);
262 cow6.size.x = 100;
263 cow6.size.y = 50;
264 cow6.origin.x = 4420;
265 cow6.origin.y = 367;
266 stage.addStageObject(cow6);
267
268 var cow7 = new SlopeBlockClass(stage, ["cow2.png", 14, 14]);
269 cow7.size.x = 100;
270 cow7.size.y = 50;
271 cow7.origin.x = 4510;
272 cow7.origin.y = 367;
273 stage.addStageObject(cow7);
274
275
276 },
277
278
279 stage;