How to do this? I have pixel projectiles up and running thanks to PixelProjectiles by Shadowdarke. The problem is that it takes an Atom as a destination type and that atom appears to be static throughout the proc. If I used a mob (for example) as a destination, the proc wont work because it relies on that atoms pixel_x and pixel_y to calculate.
So,
My first question: How do I select a movable atom from a mob?
Next. I managed to change the destination x and y (vector increment) calculation so that it will follow the target.
Prior:
dx = (A.x - owner.x) * 32 + A.pixel_x - owner.pixel_x
dy = (A.y - owner.y) * 32 + A.pixel_y - owner.pixel_y
A - destination atom
Homing:
dx = (A.x - P.x) * 32 + A.pixel_x - P.pixel_x
dy = (A.y - P.y) * 32 + A.pixel_y - P.pixel_y
P-Projectile
(it recalculates every update cycle)
The problem is that the dx and dy values decrease as the projectile closes on its destination. So it slows down. (these values work as increments for the projectiles pixel_y and x)
Question: How to recalculate projectile's increment without losing speed?
Optional question: Is there a way to make icons slide between objects outside of tile boundaries without using pixel movement?
Thank you for your help. :)
The way you're doing it isn't bad either; you just need to get a unit vector and scale it to whatever speed you want it at.