Newbie needs help to shoot ball

Hi
First of all, thanks for creating a superb product.

I looked at the sample app monsters vs ghosts and realized the actual shooting progress is what I have to have fr my new ball game. But I can´t make it work at all and now I haven´t a clue where to start…

I need a small ball on the left hand side which lies insida a slingshot. When dragged it will control speed/force and heading of the ball.

Please head me into the right direction folks. [import]uid: 22737 topic_id: 5574 reply_id: 305574[/import]

I’ve no time now to delve into the code but a quick tip would be first to dissect the problem into smaller parts.

  1. Create the ball. Use either image or a circle and place the ball on certain position on screen.
  2. Add the ball to “physics”, you have to import the physics module first by
  3. Launch the ball in different directions without dragging, i.e. just by applying ball:setLinearVelocity

After you’re comfortable with the above and your ball flies, think how to design the sling itself. Again here dissect it into smaller problems:

  1. Make the arguments to ball:setLinearVelocity come not from numbers but from a finger movement
  2. Make the ball follow the drag of the finger movement from 4
  3. Make the sling animation to follow 4 and 5

I know all of the above is explained in different parts of the docs and is quite easily achievable, just take one step at a time. Personally I’d probably have must trouble with #6 which strangely has least to do with the mechanics of the game itself. [import]uid: 21280 topic_id: 5574 reply_id: 19050[/import]