Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Collide(PhysicalObject that)
- {
- if (new Rectangle(this.bounds.X + (int)this.speed.X,
- this.bounds.Y,
- this.bounds.Width + (int)this.speed.X,
- this.bounds.Height).Intersects(that.bounds))
- {
- this.speed.X = 0;
- }
- else if (new Rectangle(this.bounds.X,
- this.bounds.Y + (int)this.speed.Y,
- this.bounds.Width,
- this.bounds.Height + (int)this.speed.Y).Intersects(that.bounds))
- {
- this.speed.Y = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment