private Rectangle tangle; //Rectangle to show the texture #endregion Fields #region Constructors public Sprite(Vector2 position, Texture2D texture, SpriteBatch sprite, GraphicsDeviceManager graphics) { color = Color.White; this.position = position; rotation = 0; scale = new Vector2(1, 1); effect = SpriteEffects.None; spriter = sprite; this.texture = texture; tangle = new Rectangle(0, 0, this.texture.Width, this.texture.Height); hitbox = new Rectangle((int)this.position.X, (int)this.position.Y, this.texture.Width, this.texture.Height); origin = new Vector2(this.texture.Width / 2, this.texture.Height / 2); screenSize = new Vector2(graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight); body = new PhysicsBody(new Rectangle((int)position.X, (int)position.Y, tangle.Width, tangle.Height), this); }
public static bool RemoveBody(PhysicsBody body) { return bodies.Remove(body); }
public static void AddBody(PhysicsBody body) { bodies.Add(body); }