I'm trying to create a wall around my play area, the play area is an area in meters (mapped to real world coordinates), which is, at this point, a rectangle with the following coordinates:
Top = 1.5
Bottom = 3
Left = -0.75
Right = 0.75
But the final numbers aren't important right now. The rectangle is in the screenArea
variable in the code below.
I'm trying to set up a wall around the screen area, does the code below do that? It's not working, and I'm thinking it might have something to do with the fact that 0,0 isn't within the area.
Before, I was making the wall between (0,0) and (Width, Height) and it worked OK, but I needed to offset my sprites and do some very unnatural (and I think unnecessary) coordinates juggling.
// set up wall
fDef.filter.categoryBits = 0x02;
fDef.filter.maskBits = 0x04;\
fDef.shape = &bShape;
fDef.density = 100.f;
walls = world.CreateBody(&bDef);