In many arcade-style games with a horizontally scrolling camera, enemies spawn offscreen, either left or right, and traverse the screen in the opposite direction.
Spawning enemies is easy enough, but my question concerns the logic of getting them to spawn in an arcade-type way, just offscreen and according to the predefined patterns of the designer.
One idea I thought of was designating trigger areas in my level. When the player enters a trigger, enemy spawn points associated with that trigger then spawn enemies. But with a scrolling camera, sometimes as the camera scrolls, those spawn points enter the viewport and enemies spawn on screen out of nowhere.
What is a good technique to achieve arcade-style enemy spawns?
Here are two examples of the types of spawns I am thinking about: