示例#1
0
文件: Walker.cs 项目: Celicath/RRRR
 /// <summary>
 /// 걷는 사람을 만든다.
 /// </summary>
 /// <param name="tex">텍스쳐</param>
 /// <param name="x">x 좌표</param>
 /// <param name="y">y 좌표</param>
 /// <param name="speed">속도</param>
 public Walker(WalkerType type, int x, float y, float speed)
 {
     this.type = type;
     this.x = x;
     this.y = y;
     this.speed = speed;
 }
示例#2
0
文件: Walker.cs 项目: Celicath/RRRR
 /// <summary>
 /// 걷는 사람을 만든다.
 /// </summary>
 /// <param name="tex">텍스쳐</param>
 /// <param name="x">x 좌표</param>
 /// <param name="y">y 좌표</param>
 /// <param name="speed">속도</param>
 public Walker(WalkerType type, int x, float y, float speed)
 {
     this.type  = type;
     this.x     = x;
     this.y     = y;
     this.speed = speed;
 }
 public void InitGenericWalker(int _maxHealth, int _startingDamage, float _startingSpeed, float _startingAttackSpeed, WalkerType _type, EnemyWalkingTrack _myTrack, LayerMask _attackMask)
 {
     AttackLayerMask     = _attackMask;
     myTrack             = _myTrack;
     maxHealth           = _maxHealth;
     startingDamage      = _startingDamage;
     startingSpeed       = _startingSpeed;
     startingAttackSpeed = _startingAttackSpeed;
     myType         = _type;
     currentHealth  = maxHealth;
     nextTrackIndex = _type == WalkerType.Enemy ? 0 : _myTrack.Points - 1;
     alive          = true;
     if (myType == WalkerType.Enemy)
     {
         indexDiff = 1;
         if (myTrack.side == EnemyWalkingTrackSide.Left)
         {
             walkingDirection = WalkingDirection.Right;
         }
         else
         {
             walkingDirection = WalkingDirection.Left;
         }
     }
     else
     {
         indexDiff = -1;
         if (myTrack.side == EnemyWalkingTrackSide.Left)
         {
             walkingDirection = WalkingDirection.Left;
         }
         else
         {
             walkingDirection = WalkingDirection.Right;
         }
     }
 }