E-Nature wrote:Hi all
After working several months on my first Android app I think I'm ready to make my first Android game. The thing is that I have no idea how to start. I found some beginner tutorials but none of them covered what I want to do.
I want to have a sprite (it's gonna be a 2D game) which can be dragged around with the touchscreen. It also can be tossed and should jump like a ball which falls to the floor.
That's pretty much the first thing I need for my game.
Does anyone have help for me, how I can do such a thing?
Thanks a lot for any help in advance!
if your having a 2d game then there will be no z problems. with the onTouchListener you get current x and y. take away old x and y from new x and y to see what direction the user has "swiped" on the screen. based on the difference you can work out how "far" the user wants to throw the ball(however youll have to set the boundries yourself etc).
as for the bounce, you know the hieght of the ball, just have a small animation which halfs the height each bounce e.g. if the ball falls from y height, then the ball should bounce up to y/2. the next bounce the ball should only reach y/4. you can use the same approach with how fast its moving left and right.
p.s. im very tired so theres a few grammatical issues above aha