Hi,
I am trying to test a catapult like shooting game (no Angry Kangaroes). I wan't to plot/draw
a dotted (curved) direction path based on the applyLinearImpulse method. Does anyone has
a hint how to accomplish this? Also is there an example to create elastic material which you
can stretch. I've studied the AppCodingEasy Slingshot example.
Thanks,
Marc
Comments
the object will land. Not the exact place. This is also handy for debugging.
elastic material which you can stretch with your finger?
Regards,
Marc
About predicting path, I can image couple of things that you could try:
1. Calculating trajectory yourself, by using some physics knowledge
http://www.iforce2d.net/b2dtut/projected-trajectory
2. Trying to project the path using raycast (suitable when you don't have a gravity)
3. To launch invisible box2d body and mark the path (or even creating invisible copy of your world)
About Chainshape, well it depends why you need to stretch it. Chainshape can't be used as dynamic body, so if you are ok to destroy and create new static chainshape body to emulate strechness, then it's possible to do that
math too. I've never heard of raycast.
With Chainshape, do you mean also the example (/physics/chain) from
the Gideros package? When creating for example an elastic rope, is it
better to create different bended lines and put them in a texture atlas to
animate them during dragging with your finger?
Well in chain case, sure if you are creating chain you can chain them using weld or revolute joint, based on how you want the chain to behave.
And to make it more elastic, you could even use distance joints or even wheel joint. You'd need to experiment more on what behavior does it provide and what suits you
And believe me I am working on a catapult game you've never seen before
">
Marc
Likes: ar2rsawseen