realbasic-games
[Top] [All Lists]

AsyncKeyDown in Timer or Window.KeyDown?

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: AsyncKeyDown in Timer or Window.KeyDown?
From: Josh Meyer <jmeyer at msg dot ucsf dot edu>
Date: Mon, 24 Jul 2006 16:06:23 -0700
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-games at lists dot realsoftware dot com

I'm using Keyboard.AsyncKeyDown as described in the Language Reference to move an object through a game when the arrow keys are hit. I currently have my AsyncKeyDown code in Window.KeyDown, but the Language Reference suggests putting it in Timer.Action. That seems better than Window.KeyDown because then I could just enable the Timer when the game is running rather than check a boolean Property "IsGameRunning" to check the game status. Imagine a pinball game where you only want the flippers to move if a ball is in play.

I'm confused about what the Timer's Period and Mode should be. I don't get very smooth behavior when I set the Period either too low or high. Perhaps I'm missing something. Any thoughts would be welcome.

Josh

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

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


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