OSDN Git Service

checkCollidingDirection, collidingDirectionの名称変更
authorttwilb <ttwilb@users.sourceforge.jp>
Wed, 28 Aug 2013 11:36:19 +0000 (20:36 +0900)
committerttwilb <ttwilb@users.sourceforge.jp>
Wed, 28 Aug 2013 11:36:19 +0000 (20:36 +0900)
www/corelib/classes/EnemyCharacterClass.js
www/corelib/classes/EnemyCharacters/EnemyCharacterClass_Spine.js
www/corelib/classes/FireObjectClass.js
www/corelib/classes/FreeItemClass.js
www/corelib/classes/HiddenBlockClass.js
www/corelib/classes/MainCharacterClass.js
www/corelib/classes/MovableStageObjectClass.js
www/corelib/classes/OperatedCharacterClass.js
www/corelib/classes/StageObjectClass.js

index 2b54fed..c30ffc2 100644 (file)
@@ -105,14 +105,14 @@ var EnemyCharacterClass = function(stage, args){
                {
                        //メインキャラクターに衝突された
                        //ダメージの開始・終了処理
-                       if(this.collidingDirection & CollideTop){
+                       if(this.touchingDirection & CollideTop){
                                if(!this.hurting){
                                        //自分自身のダメージ有効
                                        this.hurting = true;
                                        this.hurtPerTickCount = this.hurtPerTickBase;
                                }
                        } else{
-                               if(this.collidingDirection & (CollideLeft | CollideRight)){
+                               if(this.touchingDirection & (CollideLeft | CollideRight)){
                                        if(!this.damaging){
                                                //メインキャラクタへのダメージ有効
                                                this.damaging = true;
index 34179d9..ce20975 100644 (file)
@@ -10,7 +10,7 @@ this.hurt=0;
 this.touchDamege=10;
 this.damagePerTickBase = 10;
 this.max_HP = 2000;
-if(this.collidingDirection & (CollideLeft | CollideRight | CollideTop)){
+if(this.touchingDirection & (CollideLeft | CollideRight | CollideTop)){
        if(!this.damaging){
                //メインキャラクタへのダメージ有効
                this.damaging = true;
@@ -27,7 +27,7 @@ stage.addStageObject(this);
                {
                        //メインキャラクターに衝突された
                        //ダメージの開始・終了処理
-                       if(this.collidingDirection & (CollideLeft | CollideRight | CollideTop)){
+                       if(this.touchingDirection & (CollideLeft | CollideRight | CollideTop)){
                                if(!this.damaging){
                                        //メインキャラクタへのダメージ有効
                                        this.damaging = true;
index 4b76061..ccc11c2 100644 (file)
@@ -32,14 +32,14 @@ var FireObjectClass = function(stage, args){
                {
                        //メインキャラクターに衝突された
                        //ダメージの開始・終了処理
-                       if(this.collidingDirection & CollideTop){
+                       if(this.touchingDirection & CollideTop){
                                if(!this.hurting){
                                        //自分自身のダメージ有効
                                        this.hurting = true;
                                        this.hurtPerTickCount = this.hurtPerTickBase;
                                }
                        } else{
-                               if(this.collidingDirection & (CollideLeft | CollideRight)){
+                               if(this.touchingDirection & (CollideLeft | CollideRight)){
                                        if(!this.damaging){
                                                //メインキャラクタへのダメージ有効
                                                this.damaging = true;
index a2eee13..228f7ac 100644 (file)
@@ -48,7 +48,7 @@ var FreeItemClass = function(stage, args){
                this.ownerStage.collisionMapContext.restore();
        },
        tick: function(){
-               //this.checkCollidingDirection();
+               
        },
        objectAttacked : function(obj, obj_x, obj_y)
        {
index 3ea7674..ed4a3eb 100644 (file)
@@ -20,10 +20,10 @@ var HiddenBlockClass = function(ownerStage, args)
 }.extend(BlockClass, {
        tick : function()
        {
-               this.checkCollidingDirection();
-               //console.log(this.collidingDirection.toString(2));
-               if((this.collidingDirection & this.collidingMask) == this.collidingMask){
-                       if((this.collidingDirection & this.collidingExcludeMask) == 0){
+               this.checkTouchingDirection();
+               //console.log(this.touchingDirection.toString(2));
+               if((this.touchingDirection & this.collidingMask) == this.collidingMask){
+                       if((this.touchingDirection & this.collidingExcludeMask) == 0){
                                if(this.lastCollidedTick < this.ownerStage.manager.tickCount - this.collidedTickInterval){
                                        //当たっていたら画像を表示させて、さらにこの関数をベースクラスのものに戻す。
                                        this.isPhantom = false;
index 284498a..b3e88c0 100644 (file)
@@ -5,7 +5,6 @@ var MainCharacterClass = function(stage, args){
        tick : function()
        {
                MainCharacterClass.base.prototype.tick.apply(this);
-               //console.log(this.collidingDirection.toString(2));
                if((!mainManager.runningStageName || this.ownerStage.manager.userID == this.ownerUID) && this.origin.y > 1000){
                        this.ownerStage.manager.userManager.kill();
                }
index 3d6443f..ce68d98 100644 (file)
@@ -29,7 +29,7 @@ var MovableStageObjectClass = function(stage, args)
                        this.origin.y + (this.movingSpeed.y / this.ownerStage.manager.tickPerSecond)
                );
                //\8eæ\93¾
-               this.checkCollidingDirection();
+               this.checkTouchingDirection();
                
        },
        canMoveTo: function(x, y){
index 2742cf7..bd5864b 100644 (file)
@@ -34,7 +34,7 @@ var OperatedCharacterClass = function(ownerStage, args){
        //\92Ê\8fí\83W\83\83\83\93\83v\82·\82é\82Æ\82«\82É\8cÄ\82Î\82ê\82é\81B\83W\83\83\83\93\83v\83L\81[\82ð\89\9f\82µ\82Ä\82¢\82é\8aÔ\82Í\82¸\82Á\82Æ\8cÄ\82Î\82ê\82é
        //\83W\83\83\83\93\83v\83L\81[\82ð\89\9f\82µ\82Ä\82¢\82é\8e\9e\8aÔ\82Ì\92·\82³\82É\89\9e\82\82Ä\83W\83\83\83\93\83v\82Ì\8d\82\82³\82ª\95Ï\89»\82·\82é\81B
        jump : function(){
-               if(this.jumpPower_tickCount == 0 && (this.collidingDirection & CollideBottom || this.inWater)){
+               if(this.jumpPower_tickCount == 0 && (this.touchingDirection & CollideBottom || this.inWater)){
                        //\83W\83\83\83\93\83v\82Ì\8f\89\8aú\89»
                        this.jumpEnd = OperatedCharacterClass.prototype.jumpEnd;
                        this.jumpPower_tickCount = this.jumpPower_tickCountBase;
index 4dcbdd1..37ef385 100644 (file)
@@ -23,8 +23,8 @@ function StageObject(ownerStage, args){
        this.collisionMargin = new OffsetBox(0, 0, 0, 0);
        this.collidingRange  = 6;
        //\8fÕ\93Ë\95û\8cü\83t\83\89\83O\82Í\81A\88Ú\93®\82·\82é\83I\83u\83W\83F\83N\83g\82È\82ç\88Ú\93®\8e\9e\82É\92è\8aú\93I\82É\83`\83F\83b\83N\82ð\82©\82¯\82Ä\90Ý\92è\82µ\82Ü\82·\81B
-       //\82»\82ê\88È\8aO\82Ì\8fê\8d\87\82Í\94C\88Ó\82Ì\83^\83C\83~\83\93\83O\82ÅcheckCollidingDirection\82ð\8cÄ\82Ñ\8fo\82·\82×\82µ\81B
-       this.collidingDirection = 0;
+       //\82»\82ê\88È\8aO\82Ì\8fê\8d\87\82Í\94C\88Ó\82Ì\83^\83C\83~\83\93\83O\82ÅchecktouchingDirection\82ð\8cÄ\82Ñ\8fo\82·\82×\82µ\81B
+       this.touchingDirection = 0;
        this.collidedObjects = new Array();
 }
 StageObject.prototype = {
@@ -102,9 +102,9 @@ StageObject.prototype = {
        // + - + - - 1 - +
        //     |     |
        //     + - - +
-       checkCollidingDirection: function(){
+       checkTouchingDirection: function(){
                //\8fÕ\93Ë\95û\8cü\82ð\92²\82×\82é\81B
-               this.collidingDirection = 0;
+               this.touchingDirection = 0;
                this.collidedObjects = new Array();
                var d = this.ownerStage.stageObjectLinearList;
                for(var i = 0, i_max = d.length; i < i_max; i++){
@@ -121,23 +121,23 @@ StageObject.prototype = {
                                //\8fÕ\93Ë\82Ì\89Â\94\\90«\82ª\82 \82é\82Ì\82Å\8am\94F
                                if(obj.isOverlappedWith(cbx0, cby0, cbx1, cby1)){
                                        //body
-                                       this.collidingDirection |= CollideBody;
+                                       this.touchingDirection |= CollideBody;
                                }
                                if(obj.isOverlappedWith(cbx0, cby0 - r, cbx1, cby0 - 1)){
                                        //top
-                                       this.collidingDirection |= CollideTop;
+                                       this.touchingDirection |= CollideTop;
                                }
                                if(obj.isOverlappedWith(cbx0, cby1 + 1, cbx1, cby1 + r)){
                                        //bottom
-                                       this.collidingDirection |= CollideBottom;
+                                       this.touchingDirection |= CollideBottom;
                                }
                                if(obj.isOverlappedWith(cbx0 - r, cby0, cbx0 - 1, cby1)){
                                        //left
-                                       this.collidingDirection |= CollideLeft;
+                                       this.touchingDirection |= CollideLeft;
                                }
                                if(obj.isOverlappedWith(cbx1 + 1, cby0, cbx1 + r, cby1)){
                                        //right
-                                       this.collidingDirection |= CollideRight;
+                                       this.touchingDirection |= CollideRight;
                                }
                        }
                }