So I'm trying to make a minecraft clone in construct and i made the sprites snap to a grid in editor using the snap grid checkbox. now, in the game, there is times when some sprites(or 3d shapes if like) are being created (in game) so i want those sprites to be snapping to the grid.
help. here is the game. (wasd to move, arrows to turn, left click on blocks to mine them, right click blocks to place them)
drive.google.com/file/d/1Xc426qJQTQ2MWCwL96oL3QI7fJt7ln9l/view
round their position
how...like could you be more specific?
Snapping is simply rounding to the nearest grid position. So if your grid is 16x16, you would take any x or y value, divide by 16, round that to the nearest whole number, and multiply by 16 again.
round(n/16)*16
Develop games in your browser. Powerful, performant & highly capable.
thanks a ton! it works well now! :>