added limiting if's

keeps the protagonist on screen