This project has moved. For the latest updates, please go here.

Mass cannon be 0

Topics: Developer Forum
Mar 6, 2008 at 3:45 PM
Hello mateys !

As my first game in XNA , i wanted to do a ... guess what ... Pong !!! (original idea -.-)
Anyways, after doing all the basic stuff like sprites, sounds and such, i went to the collisions. (That was the awful part) I failed miserably but then i found the "Easy to use physics engine" so why not give it a try ?

So i created bodies for the pad and the ball but when i try to run the game i get the exception : "Mass cannot be 0" Wazzat ?

Here is the code to make the bodies for both the pads :

paletaBody = BodyFactory.Instance.CreateRectangleBody(physicsSimulator, paletaRectangle.Width, paletaRectangle.Height,1);
foreach (GameObject paleta in palete)
paletaBody.Position = paleta.position;
paletaBody.IsStatic = false;

P.S.: Just for ease of understanding
paleta = pad
palete = pads