Hi,
I am learnig XNA and I have a little problem. I am programming a little arcanoid game and I have little problem with collision detection.
in update method I have somethnig like that:
| if (platforma.Collide(pilka.obramowanie)) |
| { |
| pilka.speedFactor.Y *= -1; |
| } |
Next in class platform (object of this class is called platforma) I have method collide:
| public bool Collide(Rectangle przedmiot) |
| { |
| Rectangle rectPlatform = new Rectangle((int)position.X, (int)position.Y, teksture.Width, teksture.Height); |
| return rectPlatform.Intersects(przedmiot); |
| } |
when I run the game the collision isn't detected and I don't know what is wrong. :/ Any suggestions ?