A better way to handle more than 8 directional pixel movement in Feature Requests
|
|
|
|
| Status: |
Open
Issue hasn't been assigned a status value.
|
|
|
I've been tinkering with the pixel movement system for a couple of hours now, and my only true issue with it seems to be the lack of a simple method to move an object an awkward amount of pixels in the x and y directions. step() is lacking because of its focus on the 8 major directions; taking 2 steps (one for x and one for y) can cause problems if you're not using a fairly high framerate, and even then, it only reduces the rate at which they occur (for example, if you're step()ing horizontally before vertically, you may bump an object to the west of you, rather than the object to the northwest). Using Move() is also fairly annoying because it involves handling a couple of different turf and position checks that one would expect to be handled internally.
|
pixel_move(dx, dy): Shift an object's pixel position to pixel (px + dx, py + dy).
/* Off-topic
-angle_move(angle, magnitude): Shift an object's pixel position to pixel (cos(angle) * magnitude, sin(angle) * magnitude).
-Though I'd prefer to use bearings instead of angles. 0 degrees = NORTH, 90 degrees = EAST, so bearings are just 90-angle.
*/
This kind of movement would only work if pixel positions were floats(decimals) instead of integers.
Until then, I suppose I'll have to go back to using Forum_account's Pixel Movement library.