[Grace-core] Animation module

Kim Bruce kim at cs.pomona.edu
Mon Jun 16 18:06:24 PDT 2014


I'm trying to implement animations using timers for objectdraw in Grace.  I'm used to doing this with Threads, so am not quite sure whether I am handling this in the best way.  I've attached a copy of the module that I'm using.

Most of the time students will be using the two while methods rather than working with timers directly.  They will create an animator as follows:

def animator: Animation = anAnimator.pausing(30)  // default pause time is 30 milliseconds

and then use the loops:

while{cond} do { some stuff }  // execute like a regular while, but pause for 30 ms after complete each loop

while{ cond } do {some stuff} finally {code to run at end}

The library seems to work fine almost all the time, though I am getting a few possible bugs.  It seems as though some loops may be terminating prematurely in the attached file Dripper.grace.

At any rate I would appreciate some extra eyes taking a look at it.

Kim

P.S.  If you are interested, I have started a web page for my new / revised text:  Programming with Grace.  A link to the current version of the objectdraw library is also there if you want to run the programs.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Animation.grace
Type: application/octet-stream
Size: 4566 bytes
Desc: not available
URL: <http://mailhost.cecs.pdx.edu/pipermail/grace-core/attachments/20140616/43a23cc0/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Dripper.grace
Type: application/octet-stream
Size: 1444 bytes
Desc: not available
URL: <http://mailhost.cecs.pdx.edu/pipermail/grace-core/attachments/20140616/43a23cc0/attachment-0001.obj>


More information about the Grace-core mailing list