public Configuration(FloatRectangle CollisionRectangle, float Rotation,string name) { this.CollisionRectangle = CollisionRectangle; this.rotation = Rotation; Origin = new Vector2(CollisionRectangle.size.X / 2, CollisionRectangle.size.Y / 2); this.name = name; }
public Obstacle(Game game, SpriteBatch spriteBatch,Texture2D texture ,FloatRectangle theRectangle, float theInitialRotation) : base(game) { this.spriteBatch = spriteBatch; this.texture = texture; config = new Configuration(theRectangle, theInitialRotation,"obstacle"); }
public Configuration(float x, float y, float width, float height, float Rotation) { this.CollisionRectangle = new FloatRectangle(x, y, width, height); this.rotation = Rotation; Origin = new Vector2(CollisionRectangle.size.X / 2, CollisionRectangle.size.Y / 2); }
/// <summary> /// This intersects method can be used to check a standard XNA framework Rectangle /// object and see if it collides with a Rotated Rectangle object /// </summary> /// <param name="theRectangle"></param> /// <returns></returns> public bool Intersects(FloatRectangle theRectangle) { return Intersects(new Configuration(theRectangle, 0.0f,this.name)); }