Is there a way to create an object that collides with everything? We want to have everything in our game that leaves the bounds of the screen die (its a top-down shooter, off-screen enemies won't do anything but waste ram). How would we set the flags and things to be able to do that?
Comments
here is how we define the body parts of the objects that are colliding
If you don't set them in the part itself, it's going to use the size of the objects (coming itself from the graphic). If you don't have a graphic on that object, this part actually has a 0-width dimensions.
I'd check that first and if you use a recent enough version, you can turn on physics debug display to see all the shapes rendered on screen by turning the Physics.ShowDebug config property to true.
You don't need to set your screen border part as dynamic. Dynamic means its movement can be affected by the collision with other objects, and I don't think you want that.
So I'd go with Dynamic = false.
If you need to move that object manually, you can then set AllowMoving = true.
If your ShotPart is moving fast and your screen body part is too thin, it's possible that Box2D doesn't find the collision (it's a discrete iterative solver, which means movements are not continuous). To fix that, Box2D has an option to allow more extensive checks for fast moving objects.
You can turn that on in orx with the config property HighSpeed = true on your ShortPart.
If all this is not working, let me know.
You can widen your screen border off-screen and that should help. Let me know if you want the problem.