示例#1
0
        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;
            }
        }
示例#2
0
        public override void Collided(Model with, Displayable.CollisionStatus status)
        {
            //if (with.GetType() != typeof(Character)) return;
            mModelIndex = with.ModelId;
            mState = Status.ON;

            OnStateChanged(EventArgs.Empty);
        }
示例#3
0
        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;
        }
示例#4
0
 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();
     }
 }
示例#5
0
        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();
        }
示例#6
0
 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;
 }
示例#7
0
 public Collision(Displayable.CollisionStatus status, bool blocks)
 {
     Status = status;
     BlocksMovement = blocks;
 }
示例#8
0
 public virtual void Collided(Model with, Displayable.CollisionStatus status)
 {
 }
示例#9
0
 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);
 }
示例#10
0
 public Drawable(Game game,
              Displayable displayable)
     : this(game, displayable, 0)
 {
 }