how could someone code a function to force an object travelling to obey the edit time grid of squares ??
is it possible ?
int lockToGrid(int val, int delimiter)
{
return round(val/delimiter)*delimiter;
} // This function will return the nearest multiple of the delimiter to your value.
x = lockToGrid(x, 10); // The current actors X value will now round to the nearest 10th pixel.
Users browsing this forum: No registered users and 1 guest