示例#1
0
 /// <summary>
 /// Creates a new person
 /// </summary>
 /// <param name="x">Starting x coordinate</param>
 /// <param name="y">Starting y coordinate</param>
 /// <param name="damage">Starting hit points; max damage will also be set to this value</param>
 /// <param name="isAI">True if computer controlled, false otherwise</param>
 public Person(int x, int y, int damage, bool isAI)
     : base(x, y, damage, isAI)
 {
     this.isAI = isAI;
     if (juliusLevel() == 2)
     {
         missiles = new PersonMissile[1];
     }
     else if (juliusLevel() == 3)
     {
         missiles = new PersonMissile[4];
     }
     if (juliusLevel() == 3)
     {
         shootSound = loadSound("l3s.wav");
         lockSound  = loadSound("l3a.wav");
     }
     lastStunTime  = lastPunchTime = lastMissileTime = DateTime.Now;
     stopPunchTime = Common.getRandom(1, 10);
     startSeekTime = DateTime.Now;
     blockSound    = loadSound("fb.wav");
     stunSound     = loadSound("fstun.wav");
     if (!isAI)
     {
         DSound.SetCoordinates(x, 0.0, y);
     }
 }
示例#2
0
 /// <summary>
 /// Updates this person's coordinates and also takes care of updating the listener if necessary.
 /// </summary>
 /// <param name="x">The X coordinate of the object.</param>
 /// <param name="y">The Y coordinate of the object.</param>
 public void updateCoordinates(int x, int y)
 {
     this.x = x;
     this.y = y;
     if (!isAI)
     {
         DSound.SetCoordinates(x, 0.0, y);
     }
 }