**||** Snap To Grid Code Help **||**

FallacyStudiosFallacyStudios Member Posts: 970
edited February 2012 in Working with GS (Mac)
Ok so I have a piece of code that almost does what I want. I want the screen divided into 40x40 quadrants. I have a game attribute of Cell Width and Height at 40 each. Here is my code for the snap to grid:

(ceil((floor(((game.Touches.Touch 1.Y + game.Camera Y Offset)/game.Cell Height)*2))/2))*game.Cell Height

The issue I am having with this is it is placing them with a snap to grid except I want it to snap to the center of the 40x40 ... instead it is snapping to the corner of the 4 quadrants in the region clicked. If you have any ideas on how to modify this to accomplish what I'm doing I would really appreciate it. Thanks.

**Oh and btw that same code is the exact same for the X with the exception of it being the X's.

Comments

Sign In or Register to comment.