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

                this.IsActive = false;
            }
        }
Exemplo n.º 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));

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