Android Programming

Hello!

I'm currently making a game in android, which will include a slingshot. My problem is that, while I have coded the majority of the game, I am stumped on how to do the slingshot. I was wondering if anyone would be able to help? 

Thanks :) 

what about the slingshot, the animation for it coming back, does the arc of it change when you move the mouse up or down, the code for what ever you launch? i wouldnt know how to answer these but more info always helps

probably most unhelpful comment ever but touch screen coding baffles me

sorry haha, I know how to animate it, which I'll be doing when I finish the rest of the coding (has to be finished by the end of the month, animation isn't actually needed), but basically the slingshot will be facing the background, like the opposite of Angry Birds, and when the user draws back the slingshot, there should be a crosshair for them to aim at things moving in the backround, with the whole left is right, and right is left thing, and they will also be able to go up and down.

You're probably gonna want some sort of physics engine to simulate things like gravity and the drop-off of the 'slinged' thing... Box2D is a nice & simple engine, and I believe there's an Android port (I haven't tried it myself).  You'll probably have to rebuild (in part, at least) your game to work with that though...

If you just want a simple physics simulator you could do it yourself.  Here's what I'm thinkin':

  • In your main game loop, you'll need to update the size of the fired item every iteration (things moving farther away get smaller).
  • You'll also need to update the y-coordinate of the object to simulate an arc; so maybe slightly up, and then down a little bit about a second after release say (or however you want your sling shot to fire - could just be in a straight line).
  • Then decide how long it will take for your 'bullets' to hit their targets (let's imagine it's 3 seconds).  After 3 seconds you'll have to perform a hit test against your targets - should be loads of resources online for this
  • Update scores or whatever, and clean up your object.

Hope that helped!

im a anroid dev but i never dont this   before with the android sdk but i have done this in pygame,

first  i would take this part by part ,projectile motion  is your friend 

what game engine are you using