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         stage.userControlledCharacter = main
122
123 var barn = new SlopeBlockClass(stage, ["barn.png", 49, 49]);
124
125 barn.size.x = 200;
126 barn.size.y = 150;
127 barn.origin.x = 1300;
128 barn.origin.y =236;
129 stage.addStageObject(barn);
130
131 var barn2 = new SlopeBlockClass(stage, ["barn.png", 49, 49]);
132
133 barn2.size.x = 170;
134 barn2.size.y = 150;
135 barn2.origin.x = 3700;
136 barn2.origin.y =266;
137 stage.addStageObject(barn2);
138
139 var windmill = new SlopeBlockClass(stage, ["windmill.png", 5, 5]);
140 windmill.size.x = 50;
141 windmill.size.y = 150;
142 windmill.origin.x = 1600;
143 windmill.origin.y =236;
144 stage.addStageObject(windmill);
145
146
147 var cow2 = new SlopeBlockClass(stage, ["cow2.png", 49, 49]);
148 cow2.size.x = 100;
149 cow2.size.y = 50;
150 cow2.origin.x = 850;
151 cow2.origin.y = 336;
152 stage.addStageObject(cow2);
153
154 var cow3 = new SlopeBlockClass(stage, ["cow.png", 49, 49]);
155 cow3.size.x = 100;
156 cow3.size.y = 50;
157 cow3.origin.x = 930;
158 cow3.origin.y = 336;
159 stage.addStageObject(cow3);
160
161 var fence = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
162 fence.size.x = 32;
163 fence.size.y = 32;
164 fence.origin.x = 736;
165 fence.origin.y = 352;
166 stage.addStageObject(fence);
167
168 var fence2 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
169 fence2.size.x = 32;
170 fence2.size.y = 32;
171 fence2.origin.x = 768;
172 fence2.origin.y = 352;
173 stage.addStageObject(fence2);
174
175 var fence3 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
176 fence3.size.x = 32;
177 fence3.size.y = 32;
178 fence3.origin.x = 800;
179 fence3.origin.y = 352;
180 stage.addStageObject(fence3);
181
182 var fence4 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
183 fence4.size.x = 32;
184 fence4.size.y = 32;
185 fence4.origin.x = 832;
186 fence4.origin.y = 352;
187 stage.addStageObject(fence4);
188
189 var fence5 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
190 fence5.size.x = 32;
191 fence5.size.y = 32;
192 fence5.origin.x = 864;
193 fence5.origin.y = 352;
194 stage.addStageObject(fence5);
195
196 var fence6 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
197 fence6.size.x = 32;
198 fence6.size.y = 32;
199 fence6.origin.x = 896;
200 fence6.origin.y = 352;
201 stage.addStageObject(fence6);
202
203 var fence7 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
204 fence7.size.x = 32;
205 fence7.size.y = 32;
206 fence7.origin.x = 928;
207 fence7.origin.y = 352;
208 stage.addStageObject(fence7);
209
210 var fence8 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
211 fence8.size.x = 32;
212 fence8.size.y = 32;
213 fence8.origin.x = 960;
214 fence8.origin.y = 352;
215 stage.addStageObject(fence8);
216
217 var fence9 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
218 fence9.size.x = 32;
219 fence9.size.y = 32;
220 fence9.origin.x = 992;
221 fence9.origin.y = 352;
222 stage.addStageObject(fence9);
223
224 var fence10 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
225 fence10.size.x = 32;
226 fence10.size.y = 32;
227 fence10.origin.x = 1024;
228 fence10.origin.y = 352;
229 stage.addStageObject(fence10);
230
231 var fence11 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
232 fence11.size.x = 32;
233 fence11.size.y = 32;
234 fence11.origin.x = 3712;
235 fence11.origin.y = 384;
236 stage.addStageObject(fence11);
237
238 var fence12 = new SlopeBlockClass(stage, ["fence.png", 16, 16]);
239 fence12.size.x = 32;
240 fence12.size.y = 32;
241 fence12.origin.x = 3680;
242 fence12.origin.y = 384;
243 stage.addStageObject(fence12);
244
245 var cow4 = new SlopeBlockClass(stage, ["cow.png", 14, 14]);
246 cow4.size.x = 100;
247 cow4.size.y = 50;
248 cow4.origin.x = 4010;
249 cow4.origin.y = 367;
250 stage.addStageObject(cow4);
251
252 var cow5 = new SlopeBlockClass(stage, ["cow2.png", 14, 14]);
253 cow5.size.x = 100;
254 cow5.size.y = 50;
255 cow5.origin.x = 4180;
256 cow5.origin.y = 367;
257 stage.addStageObject(cow5);
258
259 var cow6 = new SlopeBlockClass(stage, ["cow.png", 70, 70]);
260 cow6.size.x = 100;
261 cow6.size.y = 50;
262 cow6.origin.x = 4420;
263 cow6.origin.y = 367;
264 stage.addStageObject(cow6);
265
266 var cow7 = new SlopeBlockClass(stage, ["cow2.png", 14, 14]);
267 cow7.size.x = 100;
268 cow7.size.y = 50;
269 cow7.origin.x = 4510;
270 cow7.origin.y = 367;
271 stage.addStageObject(cow7);
272
273
274 },
275
276
277 stage;