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
I'm trying to make level editor where you can place blocks in 150 x 150 px grid. I tried to do event like this:
On click -> Spawn "block" at int(Mouse.X/150)*150
[code:1nny5x8x]On click -> Spawn "block" at ceil(Mouse.X/150)*150[/code:1nny5x8x]
It kinda worked occasionally but most of the time blocks just spawned in wrong places.
[b]Edit:[/b] You probably wan't to see pic
Creating the object (not spawning it) at int(Mouse.X/150)*150 should do the trick. I usually make a cursor object that's set to that, then create the tiles at its position.
Develop games in your browser. Powerful, performant & highly capable.
— I changed the origin point of the sprite to top-left and it worked. I also set it to create the object instead of spawning it.