Touching an object in a tweened animation?

by Michael » Fri, 23 Apr 2010 02:59:30 GMT

Sponsored Links
 I'm having trouble porting a simple game I developed for the iPhone
over to Android. The game has an animated ball which moves from Point
A to Point B. The user must touch the ball before it reaches point B
or lose the game. This was easy to implement on the iPhone using Core
Animation since I could locate the current position of the ball by
accessing its animation layer. In Android, I attempted to recreate the
game using tweened animation and represented the ball as a Drawable.
My issue is that I can't determine if the user is touching the spot
because the Drawable apparently bounds do not update as the ball
visually moves - making the program think the ball is always in its
original position. While searching these forums I saw an Android team
dev. confirm that you can't get the current location in a tweened
animation but offered no solution for a workaround. Can I accomplish
this on the Android using my current approach? If not, what approach
should I use?

Best regards,


Other Threads

1. multiple selection in drop down list -spinner like widget


I am wondering is there any way to create something similar to spinner
but which allows multiple selection. I guess we can select multiple
entries from ListView but I don't have much space to show all the
entires and also I need to show three different categories on the same
Activity which you can select from.

Here is what I want to do:


                      Category 1:
                       |                                            |

                      Category 2:
                       |                                            |

                      Category 3:
                       |                                            |


Thanks in advance.


2. Efficiency of requestLocationUpdates() and how to save these gps data


i'm developing a small gps application. I want to track "some" gps
data. So I use the requestLocationUpdates - function.
Now a quote from the android development reference:

"The frequency of notification or new locations may be controlled
using the minTime and minDistance parameters. If minTime is greater
than 0, the LocationManager could potentially rest for minTime
milliseconds between location updates to conserve power. If
minDistance is greater than 0, a location will only be broadcast if
the device moves by minDistance meters. To obtain notifications as
frequently as possible, set both parameters to 0. "

My question is, how much battery power will be lost, if a user wants
to track for example 100 km and i set the parameters to 0?
My second question is, how I can save the gps data efficiently?? If
the user wants to track a 100km tour, I will have 100.000 gps data (if
the device broadcast a change of location every 1m).

So I think, I have to choose the parameter values of the
requestLocationUpdates - function greater than 0.
Has anyone experience and can give me a value which gives good results
(if I drive with a bike (10-15km/h) or if i walk (5km/h)? And how can
I save a specific point during the minTime and minDist (for example if
there is a landmark)?


3. Default keyboard pop up

4. onKeyDown event unavailable for space key in ListView

5. Build time optimization while copying workspace

6. Paid App Protection, a problem of the whole Android ecosphere

7. stack overflow exception on certain sequence of UNICODE characters, I DONT HAVE TOO MANY LAYERS!