e-ucm/ead — pull request #670 by jtorrente (2014-07-07 14:35:42+00:00)
Title: Components for tracking entities' position

This PR contains three new components to make an entity vary its position according to other entity's position. How these work is better understood by seeing a demo that, unfortunately, will come on the next PR (sorry for that). Anyway, the idea is rather simple:

- MoveByEntity component: makes the holding entity update its position with the same speed as the entity being tracked. Well, not necessarily "with the same speed" since it can be set up to multiply the tracked entity's speed by a constant factor, making it move faster or slower but always with relative speed.

This is useful for making the camera follow a certain entity, for example.

- Parallax component: It's actually a special case of MoveByEntity that adjust an entity's position according to its relative position to the observer (camera). This is useful to give a sense of having elements with different z-depth in the scene.

- ChaseEntity component: makes the parent entity try to keep at between a max distance and a min distance from the tracked entity. The resulting effect is pretty cool.