Hi,
in the game i am developing, i have a character that can walk to the left and to the right. He is painted by the artist with his arms
fully extended because he brings an object. When the user press a key, an animation start (2/3 frames) and he reaches
a frontal pose. When he is perfectly frontal, he drops the object. From that moment, the object is free to fall, collide, bounce and so on with
other objects. Consider that the character is the same, but the objects he can carry are different (3/4 or more), with similar sizes.
I would really like to understand how to handle this situation with box2d.
Any idea?
A starting idea is the following. I have two bodies: the character and the objects that must be carried/dropped. I would create
a distance joint so that when the user moves the character, the object moves too.
The problem is that when the animation that brings the character to a frontal pose starts, the anchor point for the character must be
moved (the object must move to a central position). The artist could set, for each frame, the new anchor point, but i don't know if
i can change the position of the anchor point or i have to destroy the joint and re-create another joint with the new anchor point.
Another issue is that of making all this work both when the character walks to the right and to the left (same way: destroy the joint
and re-create another joint at run-time with another anchor point or move the anchor point of the character to the new position).
Thanks!
in the game i am developing, i have a character that can walk to the left and to the right. He is painted by the artist with his arms
fully extended because he brings an object. When the user press a key, an animation start (2/3 frames) and he reaches
a frontal pose. When he is perfectly frontal, he drops the object. From that moment, the object is free to fall, collide, bounce and so on with
other objects. Consider that the character is the same, but the objects he can carry are different (3/4 or more), with similar sizes.
I would really like to understand how to handle this situation with box2d.
Any idea?
A starting idea is the following. I have two bodies: the character and the objects that must be carried/dropped. I would create
a distance joint so that when the user moves the character, the object moves too.
The problem is that when the animation that brings the character to a frontal pose starts, the anchor point for the character must be
moved (the object must move to a central position). The artist could set, for each frame, the new anchor point, but i don't know if
i can change the position of the anchor point or i have to destroy the joint and re-create another joint with the new anchor point.
Another issue is that of making all this work both when the character walks to the right and to the left (same way: destroy the joint
and re-create another joint at run-time with another anchor point or move the anchor point of the character to the new position).
Thanks!