On Aug 18, 2005, at 3:19 PM, Ian Leigh wrote:

What strikes me about rev is that it's harder to manage a flow of things from a main loop. For example, a game might have a particular loop for overall control which steps through all the required stages and then draws a new frame, starting the whole thing off again. How would you best manage a game in rev? Would you have a loop off a 'start game' button which could only be interrupted by the quit action? Just wondering how others have approached laying out games and such programs?

People have already suggested using send..in, which would work for this purpose. An alternative is to use wait..with messages. This method ends up looking something like this:

on startGame
  doSetup
  repeat
    put milliseconds() into t
    doGameStuff
    if <exit conditions> then exit repeat
    wait (t + 33 - milliseconds()) milliseconds with messages
    -- gives you a max of roughly 30 fps
  end repeat
end startGame
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to