So the keys apply translates to the hero that cause him to jump and walk? Interesting, how does the jump translate work, is there a constant translate in the background to apply gravity (low distance long duration translate) and collision stops him from moving, or is it just made up of both a up and down translation? Also how do you adjust the translation up distance based on the length of the key press?
Ah, yes and for gravity! I'll be writing a tutorial on using kinetics to set and modify velocities. Basic 2D platformer systems were gathered on google and translated into SC2 kinetic data. Cliff notes:
Every game tick the unit is in the air, a stack of gravity (negative vertical velocity) is applied. When the unit lands, vertical velocity is set to 0.
On JumpKeyDown, a positive vertical velocity as added to the hero (thus starting gravity's effect on the hero).
On JumpKeyUp the vertical velocity is clamped if the hero is still ascending, limiting the height of the jump if the key is released early.
My current working model for collision keeps track of the unit's position and X/Y velocities every game tick the unit is in motion. If the unit's "hitbox" would be in intersect the ground next tick, it is prevented by a combination of reducing/removing velocity and moving the unit instantly (very short distances, to make sure the units feet always are at the same height on the ground).
Yeaah.... you're the programmers and i'm filthy casual ._. kinda understood the idea, but i'm not sure this will represent exactly the movement i want. Feel free to enlighten me anytime soon cuz the "rose pattern" in google leads to some weird crap O_O
I didn't quite use the correct term, which is my error. Basically, think of the path the moon takes. It is rotating around Earth, but Earth is rotating around the Sun. So the moon is following Earth's path aroudn the sun, but its distance to the sun is bounce back and forth as it rotates around Earth.
Edit: This weekend, I'll work up an example so you can see in more practical terms, and we can see if it is what you are looking for.
This is movement i need for my unit's ability. I used Force effect to pull in and out, because Translate kinetic doesn't allow to define vector. This kind of works in static, but when i move immortal there is asynchronisation appearing due to Force Pull speed is constant while it should be adjusted by taking in account host's movement vector. Any thoughts on this?
Arcane suggested to make another unit that will be attached to primary "moon" but will have perpendicular axis of rotation which should work. With site operation "host height" i can trick the viewer's eye so it will appear as a 2d motion. I just wonder if unit's height will have impact on search area effect.
regarding my preivous post. After fuckening with that idea for a hour i think it cannot be done because seems like that kinetic crap always works in abs coord system, not relative. Unit rotation doesn't affect the axis of driven orbitin object thus my idea is doomed.
Seems like that was designed only for map object interaction, probably will debute in some Nova infiltration mission with traps or elevator puzzles. Could use some mechanic like that conveyor belt from 1st post.