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
Our educational partners
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
How do I lock the position of a sprite so that it cannot move outside the white box shown above?
Develop games in your browser. Powerful, performant & highly capable.
The heart inside the box?
You could use 4 Sprites, one for each side or you could use a tilemap.
Couldn't you just clamp it since it's a rectangle?
clamp(x, lower, upper)
Return lower if x is less than lower, upper if x is greater than upper, else return x.