OSDN Git Service

aMovableStageObjectClass.caterpillar (坂道を登れる度合い)を追加
authorttwilb <ttwilb@users.sourceforge.jp>
Thu, 22 Aug 2013 10:13:57 +0000 (19:13 +0900)
committerttwilb <ttwilb@users.sourceforge.jp>
Thu, 22 Aug 2013 10:13:57 +0000 (19:13 +0900)
www/corelib/classes/GameStageClass.js
www/corelib/classes/MovableStageObjectClass.js
www/corelib/coresubf.js

index c1a338e..e6c50f2 100644 (file)
@@ -233,6 +233,7 @@ GameStage.prototype = {
                var fx = dx == 0, fy = dy == 0;
                var ex = sx, ey = sy;
                var gotItems = [];
+               var caterpillar = Math.abs(obj.caterpillar * dx);
                for(var i = 0; i < ct  && !(fx && fy); i++)
                {
                        //\89¼\82É\82¨\82¢\82Ä\82Ý\82é\8dÀ\95W
@@ -240,13 +241,13 @@ GameStage.prototype = {
                        
                        if(!fx && this.collideJudge(obj, ex + dx, ey, gotItems))
                        {
-                               if(this.collideJudge(obj, ex + dx, ey - 2, gotItems))
+                               if(this.collideJudge(obj, ex + dx, ey - caterpillar, gotItems))
                                {
                                        fx = true;
                                        collideDirection |= (dx > 0 ? 1 : 2);
                                }else
                                {
-                                       ey -= 2;
+                                       ey -= caterpillar;
                                }
                        }
                        
index c978564..45d524b 100644 (file)
@@ -17,6 +17,10 @@ var MovableStageObjectClass = function(stage, args)
        this.collisionMarginLeft = 6;
        this.collisionMarginRight = 6;
        this.collisionMarginBottom = 2;
+       
+       //\92i\8d·\82â\8dâ\82ð\8fæ\82è\89z\82¦\82ç\82ê\82é\83\8c\83x\83\8b 0\82¾\82Æ\8dâ\82ð\91S\82­\8fã\82ê\82È\82¢
+       this.caterpillar = 2.5;
+       
 }.extend(StageObject, {
        className: "MovableStageObjectClass",
        tick: function(){
index eb5d1e4..9bcf586 100644 (file)
@@ -11,7 +11,7 @@ function createCanvas(id, width, height, x, y, z, parent)
        //width * heightの大きさのCanvasを
        //(x,y,z)に生成する。
        //parentには、Canvasタグを包含することになるDOMオブジェクトのidを指定する。
-       canvas = document.createElement("canvas");
+       var canvas = document.createElement("canvas");
 
        canvas.id = id;
        
@@ -28,6 +28,46 @@ function createCanvas(id, width, height, x, y, z, parent)
        return canvas;
 }
 
+function createMessageBox(id, width, height, x, y, parent, color, foreColor, z)
+{
+       if(color == undefined) color = "#000";
+       if(foreColor == undefined) foreColor = "#fff";
+       
+       var base = document.createElement("div");
+       with(base.style)
+       {
+               opacity = "0.7";
+               top = y + "px";
+               left = x + "px";
+               width = width + "px";
+               height = height + "px";
+               backgroundColor = color;
+               color = foreColor;
+               position = "absolute";
+               border = "1px " + foreColor + " solid";
+               overflow = "hidden";
+               fontSize = "32px";
+       }
+       base.id = id;
+       
+       var p = document.createElement("div");
+       with(p.style)
+       {
+               position = "relative";
+               padding = "16px";
+               margin = "0 auto";
+       }
+       base.appendChild(p);
+       
+       parent.appendChild(base);
+       return base;
+}
+
+function changeMessageBox(box, message)
+{
+       
+}
+
 function createDOMObject(typestr, idstr, parentidstr)
 {
        dobj = document.createElement(typestr);