realbasic-games
[Top] [All Lists]

Re: Timer Precedence (Using Multiple Timers)

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Timer Precedence (Using Multiple Timers)
From: "Joseph J. Strout" <joe at realsoftware dot com>
Date: Thu, 17 Jun 2004 08:35:04 -0500
Delivered-to: realbasic-games at lists dot realsoftware dot com
List-help: <mailto:realbasic-games-request@lists.realsoftware.com?subject=help>
List-id: REALbasic Games <realbasic-games.lists.realsoftware.com>
List-post: <mailto:realbasic-games@lists.realsoftware.com>
References: <02BC7581-BFE7-11D8-9248-000A95EED9D2 at comcast dot net>
At 6:46 PM -0400 6/16/04, Nate Smith wrote:

If I give the faster timer a period of, lets say, 10, then the block drops at seemingly random intervals. Sometimes once every 1.5 seconds, sometimes every 4 seconds. As long as my fast timer has a period of 40ms or more, the block falls every second on the second.

That's really interesting! I certainly wouldn't expect it to work that way. I would suggest making a simple demo (just two timers and an EditField showing the interval each time the long-period one fires would do), and reporting it as a bug.

So, again, the real question is: Can I give one timer a higher priority than another?

No, but I'd say the real question is: is this the right way to do it? I think not. Drive your game with just *one* timer (or a thread, or whatever), and just keep track of how long it's been since the last "drop". On any frame where that time is a second or more, do your drop in addition to the other animation.

Best,
- Joe

--
,------------------------------------------------------------------.
|    Joseph J. Strout           REAL Software, Inc.                |
|    joe at realsoftware dot com       http://www.realsoftware.com        |
`------------------------------------------------------------------'
_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>