Caltrops might be effective.
Harmful devices that are not willfully used against specific attackers at a specific time are dangerous and are almost always unlawful.
^^^You bet...and are most disliked by first responders (LE, EMT, Fireman etc.) in case they have to enter your dwelling for other emerg. reasons.
NOT ADVISABLE !
As B. Roberts
has wisely pointed out, you have nicely provided the BG with some very convenient cover with the bookcases from two different angles if he/they are shooting into your bedroom from the living room area. He can even chose either the left or right side for most cover depending on what hand he shoots with or if two assailants, cover for both.
Your line of fire is from bedroom towards living room wall in front of apt.
Is it possible to move a bookshelf against the front living room wall in an attempt to catch stray rounds from exiting apt. when fired from bedroom?
Standing in your room facing your bedroom door, is it possible to put a dresser, bookcase or something for heavy cover on the wall left of the bedroom door opening? And for possibly sliding same in front of door(given time) to help keep door from being breeched?
Too, have you discussed with your roomy a game plan as to both your course's of action in case of such an event?
Is roomy armed as well?