I'm working on a project where I occasionally want some object to have another source of movement incorporated into current movement. From what I can tell, Glide To will override an existing glide to instead of incorporating both.
To specify what I'm wanting to accomplish, I'm going to make some assumptions for the sake of explanation. I'm assuming that when "Glide To" is used, a vector is created, going from the origin of the sprite it was called on to the desired location. What I would want is to create some other Glide To that would add to this vector. For example:
Say we have Sprite A at location (0, 0). I call Glide To (100, 0 over n seconds), then I call Glide To (0, 100 over n seconds), I would want the sprite to move to (100, 100) in 1 second. My problem does not need to account for varying n values, as they are always 1/30s.
My current idea for a solution is quite messy, and that is to keep a MovementVector variable for each sprite, which other sprites will modify, then one singular 'glide to' is called at the end of its logic loop. This brings in a lot of overhead to worry about and a significant amount of refactoring, so I'm wondering if anybody on here can help me think of a better solution?