Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
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!