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); } }
public override void ApplyEffect(MovableObject movObj) { if(movObj is PacMan) { movObj.score += this.Score; Reset(); } }
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; } }
public override void ApplyEffect(MovableObject movObj) { if (movObj is PacMan) { if (this.IsActive) { movObj.score += this.Score; } this.IsActive = false; } }
/// <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)); } } }
public GUIElement(MovableObject watchee, Vector2 position) { this.watchee = watchee; }
public override void ApplyEffect(MovableObject movObj) { throw new NotImplementedException(); }
/// <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; }
public GUIString(MovableObject watchee, Color stringColor, Vector2 position, Vector2 stringOffset) : base(watchee, position) { this.stringColor = stringColor; this.stringOffset = stringOffset; }
public void ApplyEffect(MovableObject movObj) { //do nothing }
public void ApplyEffect(MovableObject movObj) { }
TimeStampEventArgs(TimeSpan time, MovableObject sender) { this.time = time; this.sender = sender; }
public abstract void ApplyEffect(MovableObject movObj);
public static int FindAfterID(int id, MovableObject x) { if (x.ID == id) { return 1; } else { return -1; } }
/// <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; } }