Only one room can be active at a time, so you'll have to treat one room as two separate play areas. After all, values you use to limit player and camera movement are just that, numbers. Instead of designating your play field from zero to room size, you designate two sets of numbers, one for each player, and use those to clamp stuff. Room size itself is in the end just an arbitrary number. It only serves to give a handy global builtin variable to refer to (and sets the region where background image is visible, if you're using any).