예제 #1
0
 private void Init(bool showMapName, Vector2 pos, string name, string targetMap, string targetSpawn, FutileFourDirectionBaseObject.Direction exitDirection)
 {
     this.showMapName = showMapName;
         this.pos = pos;
         this.name = name;
         this.targetMap = targetMap;
         this.targetSpawn = targetSpawn;
         this.exitDirection = exitDirection;
 }
예제 #2
0
 public void HandlePlayerCollision(Player p)
 {
     if (isMoving)
         return;
     isBeingPushed = true;
     if (Mathf.Round(p.x + p.hitBox.x + p.hitBox.width/2f) > this.x - 8 && Mathf.Round( p.x + p.hitBox.x - p.hitBox.width/2f) < this.x  + 8)
     {
         if (p.y + p.hitBox.y > this.y)
             pushDir = FutileFourDirectionBaseObject.Direction.DOWN;
         else
             pushDir = FutileFourDirectionBaseObject.Direction.UP;
     }
     else if (p.x + p.hitBox.x < this.x)
         pushDir = FutileFourDirectionBaseObject.Direction.RIGHT;
     else
         pushDir = FutileFourDirectionBaseObject.Direction.LEFT;
 }