}.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;
//\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;
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 = {
// + - + - - 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++){
//\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;
}
}
}