Hi Guys just a quicky question...
I am creating a bunch of rectangles dynamically and by that i mean like this:
for (int x = 0; x < 10; x++)
for (int y = 0; y < 10; y++)
Vector2 groundPosition = new Vector2((x * 0.25f), (y * 0.25f));
testBody = BodyFactory.CreateRectangle(Game1._world, 0.25f, 0.25f, 1f, groundPosition, Color.Black);
testBody.Restitution = 0.3f;
testBody.Friction = 3f;
So as you can see there are 100 rectangles that have been created there, problem is that i want to be able to reference say block 55 to do something.
Currently in my understanding i could write:
but that only applys to the last body that was created...
Is there a way to be able to say testBody55 do this...
I thought about creating an array of bodys so i could reference them then, it work well, but on a large game map i ran out of PC memory!