Subject: Re: timer...game

>Hi!
>
>Does anyone know how to set up adding a clock that ticks down to whatever
>time the user completes draging objects to the correct spot. I guess this
>needs a button to start the drag action and the clock.
>
>Thanks
>
>B.Burton
>
Check out the starttimer function in openscript. You can start with something like the following:

to handle buttonClick
  system s_GameTime
  s_GameTime = 60  -- set the clock to 60 seconds
  get timerCapability()
  if it is null
    break
  end
  get timerStart("periodic",1000,1000,self)
  timerID of self = it
end

to handle timernotify TimerID
  system s_GameTime
  if s_GameTime > 0
    decrement s_GameTime
    put s_GameTime into text of field TimeDisplay -- your display field
  else
    get timerStop(TimerID of self)
    clear timerID of self
    request "You have run out of time."
  end
end

============================================================
John R. Hall                      602-626-7343
Biomedical Communications         602-626-2145 (FAX)
Arizona Health Sciences Center    jhall@biocom.arizona.edu
Tucson, AZ  85724
============================================================

Revised 9/7/95
brianp@u.washington.edu (Brian Parkhurst)
University of Washington
Box 357260
Seattle, WA 98195-7260
206/543-9175