I have a background that has instances of a "Window" object, and I use the "Pick a random instance" method every few seconds to select one of those windows and have a character object appear on it. This works great, but for one issue. The background scrolls, and sometimes a window that is already halfway off the screen so the user doesn't have enough time to try to destroy that character before it disappears. Is there a way to only choose an instance if it is entirely on the screen?
Yes, you can pick windows with x>ViewportLeft(layer)+Window.width/2 and x<ViewportRight(layer)-Window.width/2
(assuming that the origin image point is in the center of window sprite)
And then pick random instance from them.
Develop games in your browser. Powerful, performant & highly capable.
dop2000, that worked perfectly. Thank you!