Hmm, I must be blind because I'm not seeing anything obviously wrong.
I *think* your issue is with how you're scheduling your time.

You may want to read the Timer docs:
http://download.oracle.com/javase/1.5.0/docs/api/java/util/Timer.html#schedule%28java.util.TimerTask,%20java.util.Date%29
http://developer.android.com/reference/java/util/Timer.html

And you'll see that they recommend the *f**ixed-period execution* for things
like animations.
So, you may have better luck with schedule().

That's what I use and while it can be improved, it works well.

On Sun, May 22, 2011 at 7:16 PM, Zsolt Vasvari <[email protected]> wrote:

> You telling me from the 2 lines of code you posted, that it's not
> obvious to you what's wrong?  Even a blind could see the issue...
>
> On May 23, 10:06 am, bob <[email protected]> wrote:
> > I used a Java Timer object and a TimerTask like this for some game
> > physics
> >
> >                 if (!timergoing)
> >                 {
> >                 PhysicsTask physicsTask = new PhysicsTask();
> >
> >                 Timer tm = new Timer();
> >                 tm.scheduleAtFixedRate(physicsTask, 1000, (long)
> (1000.0f/
> > physicsFrameRate));
> >                 }
> >
> > However, the physics was somewhat choppy to my surprise.   Anyone know
> > what the deal is with this and how to make it better?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
~ Jeremiah:9:23-24
Android 2D MMORPG: http://solrpg.com/,
http://www.youtube.com/user/revoltingx

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to