public override void Collided(Model with, Displayable.CollisionStatus status) { if (status == Displayable.CollisionStatus.TOP) return; //lol??? if (status == Displayable.CollisionStatus.BOTTOM) { DisableFreeFall(); this.Velocity = new Velocity(); return; } if (with.GetType() == typeof(Wall)) { mBlockedWallId = with.ModelId; return; } if (with.GetType() != typeof(Character)) { return; } if (mBlockedWallId != -1) return; if (status == Displayable.CollisionStatus.LEFT) { this.mPosition.X = with.Left - this.Origin.X; } else if (status == Displayable.CollisionStatus.RIGHT) { this.mPosition.X = with.Right + this.Origin.X; } }
public override void Collided(Model with, Displayable.CollisionStatus status) { //if (with.GetType() != typeof(Character)) return; mModelIndex = with.ModelId; mState = Status.ON; OnStateChanged(EventArgs.Empty); }
public override void Collided(Model with, Displayable.CollisionStatus status) { if (status == Displayable.CollisionStatus.TOP) return; if (with.GetType() != typeof(Character)) return; Character chara = (Character)with; if (mPlayerIndex != (PlayerIndex)chara.Index) return; mDoorStatus = DoorStatus.OPEN; }
public override void Collided(Model with, Displayable.CollisionStatus status) { if (ProjectHelper.IsDebugNoKill) return; if (status != Displayable.CollisionStatus.BOTTOM) return; if (with.IsDestroyed) return; if (with.GetType() != typeof(Character)) return; Character chara = (Character)with; if (chara.CharacterPlayerIndex == mPlayerIndex || mPlayerIndex == PlayerIndex.Three) { with.Destroy(); } }
public Drawable(Game game, Displayable displayable, int parameterized) : base(game) { Init(parameterized); Visible = true; mDisplayable = displayable; mTexture = LoadTexture(); mCurrentFrame = new Frame(); mScale = 1.0f; mRotation = 0.0f; base.Initialize(); }
public virtual CollisionStatus IsColliding(Displayable other) { if (!other.AreaWall.Intersects(this.AreaWall)) return CollisionStatus.NONE; if (other.LeftWall.Intersects(this.RightWall)) { return CollisionStatus.LEFT; } if (other.RightWall.Intersects(this.LeftWall)) { return CollisionStatus.RIGHT; } if (other.BottomWall.Intersects(this.TopWall)) { return CollisionStatus.BOTTOM; } if (other.TopWall.Intersects(this.BottomWall)) return CollisionStatus.TOP; if (other.AreaWall.Intersects(this.AreaWall)) return CollisionStatus.UNKNOWN; return CollisionStatus.NONE; }
public Collision(Displayable.CollisionStatus status, bool blocks) { Status = status; BlocksMovement = blocks; }
public virtual void Collided(Model with, Displayable.CollisionStatus status) { }
public override void Collided(Model with, Displayable.CollisionStatus status) { //we care about collectable collisions if (with.GetType() != typeof(Collectable)) return; mScore += ((Collectable)with).GetPoints(); with.Destroy(); base.Collided(with, status); }
public Drawable(Game game, Displayable displayable) : this(game, displayable, 0) { }