Beispiel #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);
     }
 }
Beispiel #2
0
 public override void ApplyEffect(MovableObject movObj)
 {
     if(movObj is PacMan)
     {
         movObj.score += this.Score;
         Reset();
     }
 }
Beispiel #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;
            }
        }
Beispiel #4
0
        public override void ApplyEffect(MovableObject movObj)
        {
            if (movObj is PacMan)
            {
                if (this.IsActive)
                {
                    movObj.score += this.Score;
                }

                this.IsActive = false;
            }
        }
Beispiel #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));

                }
            }
        }
Beispiel #6
0
 public GUIElement(MovableObject watchee, Vector2 position)
 {
     this.watchee = watchee;
 }
Beispiel #7
0
 public override void ApplyEffect(MovableObject movObj)
 {
     throw new NotImplementedException();
 }
Beispiel #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;
 }
Beispiel #9
0
 public GUIString(MovableObject watchee, Color stringColor, Vector2 position, Vector2 stringOffset)
     : base(watchee, position)
 {
     this.stringColor = stringColor;
     this.stringOffset = stringOffset;
 }
Beispiel #10
0
 public void ApplyEffect(MovableObject movObj)
 {
     //do nothing
 }
Beispiel #11
0
 public void ApplyEffect(MovableObject movObj)
 {
 }
 TimeStampEventArgs(TimeSpan time, MovableObject sender)
 {
     this.time = time;
     this.sender = sender;
 }
Beispiel #13
0
 public abstract void ApplyEffect(MovableObject movObj);
Beispiel #14
0
 public static int FindAfterID(int id, MovableObject x)
 {
     if (x.ID == id)
     {
         return 1;
     } else
     {
         return -1;
     }
 }
Beispiel #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;
     }
 }