Simplest Way? in Design Philosophy
|
|
I know Forum_account's Pixel Movement libraries handle it very nicely, but what I want to know is if there's a very basic algorithm for fractional pixel movement. What I mean by that is, of course, moving by fractions of a pixel at a time. The importance of that to me comes from usage of math slightly more complex than addition and subtraction (mainly trig).
The current basic "native pixel movement" requires you to shift positions by integer(s) at a time. This inaccuracy is problematic in a number of cases. Mainly, at higher frames-per-second, the minimum speed limit of 1p/t(pixel per tick) really noticeable. There are also obvious rounding issues with trig functions. They simply won't work with low speeds, causing you to only be able to move one of the 8 directions at rounded speeds. Using the "simple" Move(loc, dir, step_x + dx, step_y + dy) won't use BYOND's awesome pixel-perfect collision detection, where, if an object's bounding box intersects (or possibly even overshoots?) another, it is instantly pushed back.
What I ask for is the simplest fully-functional method that best uses BYOND's native pixel movement support while providing fractional displacements. Forum_account's technique is to build up the fractional parts and add the integer parts. Is there a simpler way that replaces less of BYOND's native functionality?
|