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
Hi there,
Is there any way to have the whole layout split into a grid with its own X and Y values? The grid would obviously be made of squares bigger than a single pixel.
Develop games in your browser. Powerful, performant & highly capable.
Do you just want to show a grid, or display objects snapped to a grid?
Snapping to a grid is easy, just set every object's X and Y to:
round(Object.X / 32) * 32
round(Object.Y / 32) * 32
where 32 is the size of the grid cell.
Thanks!
Just another quick question, if the objects are snapped to a grid, if an object is one cell above another (say obj1.y=1 & obj2.y=2 on the grid) would they still be considered touching (for any collision events)?
I'm not sure, try it and see. You might want to compare positions directly instead of testing for collisions anyway.