-
-var PCDSLStageClass = function(stgInfo, tbl)
-{
- //args:[tbl, mainCharacter]
- PCDSLStageClass.base.apply(this, []);
-
- //initalize process
- if(stgInfo.width) this.scrollMaxX = (stgInfo.width - 640 >= 0 ? stgInfo.width - 640 : 0);
- if(stgInfo.background){
- var back = document.createElement('img');
- back.src = "images/" + stgInfo.background;
- this.background = back;
- }
- if(stgInfo.BGM){
- this.BGM = stgInfo.BGM;
- }
- if(stgInfo.waterLevel){
- this.waterLevel = stgInfo.waterLevel;
- }
- if(stgInfo.spawnLocation instanceof Array){
- this.spawnLocation = stgInfo.spawnLocation;
- } else{
- this.spawnLocation = [33, 33];
- }
- if(stgInfo.mainProperty){
- this.mainProperty = stgInfo.mainProperty;
- } else{
- this.mainProperty = null;
- }
-
- var lx, ly, x, y;
- for(y = 0, ly = tbl.length; y < ly; y++)
- {
- for(x = 0, lx = tbl[y].length; x < lx; x++)
- {
- var item = tbl[y][x];
- var obj;
-
- if(item != null && item.base)
- {
- var adjust = new Point2D(0, 0)
- var sync = false;
-
- if(item.args){
- //item\82ª {base: ... , args : ...}\82Ì\8c`\8e®
- //\95K\90{\83v\83\8d\83p\83e\83B
- if(item.args instanceof Array)
- {
- //\8aî\96{\93I\82É\94z\97ñ\82Ì\82Ý\82ð\8eó\82¯\93ü\82ê\82é\81B
- obj = new (item.base)(this, item.args);
- } else{
- //\94z\97ñ\82É\93ü\82ê\82Ä\82 \82°\82é
- obj = new (item.base)(this, [item.args]);
- }
- } else{
- //\88ø\90\94\8ew\92è\82È\82µ:stage\83C\83\93\83X\83^\83\93\83X\82Ì\82Ý\82ð\88ø\90\94\82É\82Â\82¯\82é
- obj = new item(this);
- }
- //\88È\89º\82Í\94C\88Ó\83v\83\8d\83p\83e\83B
- if(item.prop)
- {
- /// {prop: { propName: "value" }\82Ì\8c`\82Å\83v\83\8d\83p\83e\83B\82ª\8ew\92è\82³\82ê\82Ä\82¢\82é
- for(var propName in item.prop)
- {
- //\83I\83u\83W\83F\83N\83g\82É\83v\83\8d\83p\83e\83B\82ð\90Ý\92è
- obj[propName] = item.prop[propName];
- }
- }
- if(item.adjust)
- {
- // adjust : [xOffset, yOffset]\82Ì\8c`\82Å\88Ê\92u\82Ì\94÷\92²\90®\82ª\82È\82³\82ê\82Ä\82¢\82é
- adjust = new Point2D(item.adjust[0], item.adjust[1]);
- }
- if(item.extid)
- {
- //\83X\83e\81[\83W\93à\82Å\83O\83\8d\81[\83o\83\8b\82©\82Â\92P\88ê\82È\83I\83u\83W\83F\83N\83g\82ÌID
- obj.extObjectId = item.extid;
- }
- if(item.sync)
- {
- //\83l\83b\83g\83\8f\81[\83N\8dX\90V\82ð\82·\82é\82©\82Ç\82¤\82©
- sync = item.sync;
- }
-
- //\94z\92u
- obj.origin = new Point2D(x * 32 + adjust.x, y * 32 + adjust.y);
- this.addStageObject(obj, sync);
- }
- }
- }
-}.extend(HorizonalScrollStageClass, {
- runStage: function(){
- if(this.manager.userManager.characterBaseClass){
- //\83L\83\83\83\89\83N\83^\81[\82ª\90Ý\92è\82³\82ê\82Ä\82¢\82½\82ç\82»\82ê\82ð\83\81\83C\83\93\82Æ\82µ\82Ä\8eg\82¤
-
- this.userControlledCharacter = new this.manager.userManager.characterBaseClass(this, null);
- if(this.mainProperty){
- for(var propName in this.mainProperty){
- //\83\81\83C\83\93\83L\83\83\83\89\82É\83v\83\8d\83p\83e\83B\82ð\90Ý\92è
- this.userControlledCharacter[propName] = this.mainProperty[propName];
- }
- }
- this.userControlledCharacter.origin.x = this.spawnLocation[0];
- this.userControlledCharacter.origin.y = this.spawnLocation[1];
- }
- HorizonalScrollStageClass.prototype.runStage.apply(this, []);
- this.manager.setBackgroundMusic(this.BGM);
- this.manager.addWidget(new UserStateWidgetClass(this.manager));
- this.manager.addWidget(new PickedItemWidgetClass(this.manager));
- this.manager.addWidget(new BreadItemWidgetClass(this.manager));
- this.manager.addWidget(new TimerWidgetClass(this.manager));
- }
-});
-
+\r
+var PCDSLStageClass = function(stgInfo, tbl)\r
+{\r
+ //args:[tbl, mainCharacter]\r
+ PCDSLStageClass.base.apply(this, []);\r
+\r
+ //initalize process\r
+ if(stgInfo.width) this.scrollMaxX = (stgInfo.width - 640 >= 0 ? stgInfo.width - 640 : 0);\r
+ if(stgInfo.background){\r
+ var back = document.createElement('img');\r
+ back.src = "images/" + stgInfo.background;\r
+ this.background = back;\r
+ }\r
+ if(stgInfo.BGM){\r
+ this.BGM = stgInfo.BGM;\r
+ }\r
+ if(stgInfo.waterLevel){\r
+ this.waterLevel = stgInfo.waterLevel;\r
+ }\r
+ if(stgInfo.spawnLocation instanceof Array){\r
+ this.spawnLocation = stgInfo.spawnLocation;\r
+ } else{\r
+ this.spawnLocation = [33, 33];\r
+ }\r
+ if(stgInfo.mainProperty){\r
+ this.mainProperty = stgInfo.mainProperty;\r
+ } else{\r
+ this.mainProperty = null;\r
+ }\r
+ \r
+ var lx, ly, x, y;\r
+ for(y = 0, ly = tbl.length; y < ly; y++)\r
+ {\r
+ for(x = 0, lx = tbl[y].length; x < lx; x++)\r
+ {\r
+ var item = tbl[y][x];\r
+ var obj;\r
+ \r
+ if(item != null && item.base)\r
+ {\r
+ var adjust = new Point2D(0, 0)\r
+ var sync = false;\r
+ \r
+ if(item.args){\r
+ //item\82ª {base: ... , args : ...}\82Ì\8c`\8e®\r
+ //\95K\90{\83v\83\8d\83p\83e\83B\r
+ if(item.args instanceof Array)\r
+ {\r
+ //\8aî\96{\93I\82É\94z\97ñ\82Ì\82Ý\82ð\8eó\82¯\93ü\82ê\82é\81B\r
+ obj = new (item.base)(this, item.args);\r
+ } else{\r
+ //\94z\97ñ\82É\93ü\82ê\82Ä\82 \82°\82é\r
+ obj = new (item.base)(this, [item.args]);\r
+ }\r
+ } else{\r
+ //\88ø\90\94\8ew\92è\82È\82µ:stage\83C\83\93\83X\83^\83\93\83X\82Ì\82Ý\82ð\88ø\90\94\82É\82Â\82¯\82é\r
+ obj = new item(this);\r
+ }\r
+ //\88È\89º\82Í\94C\88Ó\83v\83\8d\83p\83e\83B\r
+ if(item.prop)\r
+ {\r
+ /// {prop: { propName: "value" }\82Ì\8c`\82Å\83v\83\8d\83p\83e\83B\82ª\8ew\92è\82³\82ê\82Ä\82¢\82é\r
+ for(var propName in item.prop)\r
+ {\r
+ //\83I\83u\83W\83F\83N\83g\82É\83v\83\8d\83p\83e\83B\82ð\90Ý\92è\r
+ obj[propName] = item.prop[propName];\r
+ }\r
+ }\r
+ if(item.adjust)\r
+ {\r
+ // adjust : [xOffset, yOffset]\82Ì\8c`\82Å\88Ê\92u\82Ì\94÷\92²\90®\82ª\82È\82³\82ê\82Ä\82¢\82é\r
+ adjust = new Point2D(item.adjust[0], item.adjust[1]);\r
+ }\r
+ if(item.extid)\r
+ {\r
+ //\83X\83e\81[\83W\93à\82Å\83O\83\8d\81[\83o\83\8b\82©\82Â\92P\88ê\82È\83I\83u\83W\83F\83N\83g\82ÌID\r
+ obj.extObjectId = item.extid;\r
+ }\r
+ if(item.sync)\r
+ {\r
+ //\83l\83b\83g\83\8f\81[\83N\8dX\90V\82ð\82·\82é\82©\82Ç\82¤\82©\r
+ sync = item.sync;\r
+ }\r
+ \r
+ //\94z\92u\r
+ obj.origin = new Point2D(x * 32 + adjust.x, y * 32 + adjust.y);\r
+ this.addStageObject(obj, sync);\r
+ }\r
+ }\r
+ }\r
+}.extend(HorizonalScrollStageClass, {\r
+ runStage: function(){\r
+ if(this.manager.userManager.characterBaseClass){\r
+ //\83L\83\83\83\89\83N\83^\81[\82ª\90Ý\92è\82³\82ê\82Ä\82¢\82½\82ç\82»\82ê\82ð\83\81\83C\83\93\82Æ\82µ\82Ä\8eg\82¤\r
+ \r
+ this.userControlledCharacter = new this.manager.userManager.characterBaseClass(this, null);\r
+ if(this.mainProperty){\r
+ for(var propName in this.mainProperty){\r
+ //\83\81\83C\83\93\83L\83\83\83\89\82É\83v\83\8d\83p\83e\83B\82ð\90Ý\92è\r
+ this.userControlledCharacter[propName] = this.mainProperty[propName];\r
+ }\r
+ }\r
+ this.userControlledCharacter.origin.x = this.spawnLocation[0];\r
+ this.userControlledCharacter.origin.y = this.spawnLocation[1];\r
+ }\r
+ HorizonalScrollStageClass.prototype.runStage.apply(this, []);\r
+ this.manager.setBackgroundMusic(this.BGM);\r
+ this.manager.addWidget(new UserStateWidgetClass(this.manager));\r
+ this.manager.addWidget(new PickedItemWidgetClass(this.manager));\r
+ this.manager.addWidget(new BreadItemWidgetClass(this.manager));\r
+ this.manager.addWidget(new TimerWidgetClass(this.manager));\r
+ }\r
+});\r
+\r