示例#1
0
 public void ApplyEffect(MovableObject movObj)
 {
     if(!
         ((new Rectangle((int)movObj.Center.X, (int)movObj.Center.Y, 1, 1)).Intersects(movObj.CurrentCell.IntersectRectangle)) && movObj.Direction == teleportDirection)
     {
         movObj.SetCurrentCell(target);
     }
 }
示例#2
0
 public override void ApplyEffect(MovableObject movObj)
 {
     if(movObj is PacMan)
     {
         movObj.score += this.Score;
         Reset();
     }
 }
示例#3
0
        public void ApplyEffect(MovableObject movObj)
        {
            if(movObj is PacMan)
            {
                if (this.actualCell.PickUp.IsActive == true)
                {
                    movObj.score += actualCell.PickUp.Score;
                }

                this.actualCell.PickUp.IsActive = false;
            }
        }
示例#4
0
        public override void ApplyEffect(MovableObject movObj)
        {
            if (movObj is PacMan)
            {
                if (this.IsActive)
                {
                    movObj.score += this.Score;
                }

                this.IsActive = false;
            }
        }
示例#5
0
        /// <summary>
        /// Applys an effect to a MovableObject if that object  is a PacMan
        /// </summary>
        /// <param name="movObj">the movable object that hit this PowerUp</param>
        public override void ApplyEffect(MovableObject movObj)
        {
            if (movObj is PacMan)
            {
                if (this.IsActive)
                {
                    movObj.CellsPerSecond *= 1.5f;
                    movObj.PowerUpTimer += powerUpTimer;

                   this.IsActive = false;
                   InvokeOnPickedUp(new PowerUpEffectEventArgs(5000, 0.8f, EGhostBehaviour.Fright));

                }
            }
        }
示例#6
0
 public GUIElement(MovableObject watchee, Vector2 position)
 {
     this.watchee = watchee;
 }
示例#7
0
 public override void ApplyEffect(MovableObject movObj)
 {
     throw new NotImplementedException();
 }
示例#8
0
 /// <summary>
 /// Constructor for a camera following an object
 /// </summary>
 /// <param name="zoom">Zoom factor</param>
 /// <param name="rotation">Rotation in radians</param>
 /// <param name="followingObject">The object the camera has to follow</param>
 /// <param name="graphicsDevice">A graphics device</param>
 public Camera(float zoom, float rotation, MovableObject followingObject, GraphicsDevice graphicsDevice)
     : this(zoom, followingObject.Center, rotation, false, graphicsDevice)
 {
     this.followingObject = followingObject;
 }
示例#9
0
 public GUIString(MovableObject watchee, Color stringColor, Vector2 position, Vector2 stringOffset)
     : base(watchee, position)
 {
     this.stringColor = stringColor;
     this.stringOffset = stringOffset;
 }
示例#10
0
 public void ApplyEffect(MovableObject movObj)
 {
     //do nothing
 }
示例#11
0
 public void ApplyEffect(MovableObject movObj)
 {
 }
示例#12
0
 TimeStampEventArgs(TimeSpan time, MovableObject sender)
 {
     this.time = time;
     this.sender = sender;
 }
示例#13
0
 public abstract void ApplyEffect(MovableObject movObj);
示例#14
0
 public static int FindAfterID(int id, MovableObject x)
 {
     if (x.ID == id)
     {
         return 1;
     } else
     {
         return -1;
     }
 }
示例#15
0
 /// <summary>
 /// Compares two MovableObjects, after the ID
 /// </summary>
 /// <param name="x">The first MovableObject</param>
 /// <param name="y">The second MovableObject</param>
 /// <returns>0 if they are equall, -1 if the first is smaller and 1 if the first is bigger</returns>
 public static int Compare(MovableObject x, MovableObject y)
 {
     if (x.controller.ID> y.controller.ID)
     {
         return 1;
     }
     else if (x.controller.ID < y.controller.ID)
     {
         return -1;
     }
     else
     {
         return 0;
     }
 }