I'm having a heck of a time with is. I looked through the manual. I've looked many other places, asked colleagues etc.
I create objects in my game like this:
*_object is a vector <Object>
*Object is a class (.as file)
*The object at the end is the texture.
_object(push.Object(createPlayer(x,y,etc,etc), PlayerImage()));
_object(push.Object(createEnemy(x,y,etc,etc), EnemyImage()));
Now I need to create parts of one character in separate functions and connect them with a joint.
_object(push.Object(createPlayerHead(x,y,etc,etc), PlayerHead()));
_object(push.Object(createPlayerBody(x,y,etc,etc), PlayerBody()));
No matter where the joint is initialized, it will not work. I tried in the functions, outside, in its own function, in the main class, in a separate file, everywhere.
It does work if you combine the functions into one. But I need them separate.
How can I Initialize a joint between two bodies when the bodies are created in separate functions in the method shown above?
Thanks for taking the time to read this.
I create objects in my game like this:
*_object is a vector <Object>
*Object is a class (.as file)
*The object at the end is the texture.
_object(push.Object(createPlayer(x,y,etc,etc), PlayerImage()));
_object(push.Object(createEnemy(x,y,etc,etc), EnemyImage()));
Now I need to create parts of one character in separate functions and connect them with a joint.
_object(push.Object(createPlayerHead(x,y,etc,etc), PlayerHead()));
_object(push.Object(createPlayerBody(x,y,etc,etc), PlayerBody()));
No matter where the joint is initialized, it will not work. I tried in the functions, outside, in its own function, in the main class, in a separate file, everywhere.
It does work if you combine the functions into one. But I need them separate.
How can I Initialize a joint between two bodies when the bodies are created in separate functions in the method shown above?
Thanks for taking the time to read this.