Example #1
0
        public int traceID = 0; //TODO: this too

        #endregion Fields

        #region Constructors

        public PhysObj(Texture2D texture, Vector2 position)
            : base(texture, position)
        {
            if (texture != null)
            {
                halfWidth = texture.Width / 4;
                halfHeight = texture.Height / 4;
                hitBox = new CollisionBox(this, new Vector2(texture.Width / 2, texture.Height / 2));
                hitBox.SetPosition(position);
                checkpoint = position;
            }
        }
Example #2
0
 public bool CheckCollision(CollisionBox box)
 {
     return GetAABB().CheckAABBCollision(box.GetAABB());
 }
Example #3
0
 public override void SetAnimationStuff(int _minRow, int _minCol, int _rows, int _cols, int _cellW, int _cellH, int _frames, int _animationRate)
 {
     base.SetAnimationStuff(_minRow, _minCol, _rows, _cols, _cellW, _cellH, _frames, _animationRate);
     grabBox = new CollisionBox(this, new Vector2(halfWidth * 3, halfHeight));
 }
Example #4
0
        public Player(GSPlay gsPlay, PlayerObjectMode playerIndex, Texture2D texture, Vector2 position)
            : base(texture, position)
        {
            this.gsPlay = gsPlay;
            regularTexture = texture;
            this.playerObjectMode = playerIndex;
            playerTangible = playerIndex;
            playerVisible = playerIndex;
            gravity = new Vector2(0, .5f); //TODO: .5f
            grabBox = new CollisionBox(this, new Vector2(halfWidth * 2, halfHeight * 2));

            if (playerIndex == PlayerObjectMode.One) auraColor = new Color(255, 240, 64);
            else auraColor = new Color(64, 240, 255);
        }
Example #5
0
 public void SetCollisionBox(float width, float height, Vector2 offset)
 {
     hitBox = new CollisionBox(this, new Vector2(width, height));
     hitBox.SetOffset(offset);
     hitBox.SetPosition(position);
 }