[squeakland] Slow down turtle graphics rendering?

Steve Thomas sthomas1 at gosargon.com
Mon Oct 17 07:21:56 EDT 2011

Well you could create your own scripting tiles (sort of) similar to the way
Bert did in his Squeakfest talk
<http://www.youtube.com/watch?v=WUxMP46PM-I>(highly recommend).

Attached is a simple version.  The following steps were used to create it:

   1. Get a rectangle from the supplies bin and size it to scripting tile
   size (you can adjust later)
   2. Open the rectangles viewer and add two variables:
      1. myPlayer (click on menu icon next to variable name and click on
      "change value type" and set to "Player")
      2. myValue
   3. Get a "simple watcher" for you myPlayer variable and embed it in the
   rectangle from step 1
      1. Two ways to embed:
         1. Method 1:
            1. From the Rectangle halo, click on the menu item and check
            "accept drops" (be sure to uncheck when done)
            2. drag the watcher onto the Rectangle
         2. Method 2:
            1. Drag the watcher over the Rectangle
            2. Get the watcher's halo and from the menu select "embed" then
            select "Rectangle"
         4. Embed some text in your Rectangle ("Forward By" or "Turn By)
   5. Embed a "simple watcher" for myValue in the Rectangle
   6. Create a script for the rectangle that moves [myPlayer | forward by |
   myValue] to do this not obvious thing:
   1. drag out a forward by tile which will create a script.
      2. Then from the viewer drag the "Rectangle's|myPlayer" tile over the
      word "Rectangle" in the scripting tile you created in the previous step.
      Notice anything?
      3. Then from the viewer drag the "Rectangle's|myvalue" tile over the 5
      in the scripting tile,
      4. Name this script "action"
   7. Do the same for to create a turn tile
   8. Then drag these two tiles into a holder
   9. Create a script for the holder to:
      1. Increase cursor by 1
      2. Holder's|player at cursor - do - action (get the do tile from the
      holder's scripting category)
   10. You can then set the "tick rate" in the script to say 0.5 or whatever
   value you want.

I should probably create a short Etoy's minute on this, but for now watch
Bert's video, it's longer but worth the watch.


On Mon, Oct 17, 2011 at 6:18 AM, R.D. Latimer <rdlatimer at gmail.com> wrote:

> Etoys renders very fast, which is good. But is there a way to slow down the
> graphic rendering so students could see it unfold?
> I have a simple spinSquare project:
> drawSquare script
>   repeat 4: forward 150 turn 90
> spinSquare script
>   repeat 36: drawSquare turn 10
> I only need to run the script once, with the ! , I'm not using the clock
> timer to continually display.
> The design pattern of the spinning squares happens instantaneously. Can I
> slow this rendering somehow? like with an internal 'wait' or 'pause' for a
> fraction of a second.
> Thanks,
> Randy Latimer
> _______________________________________________
> squeakland mailing list
> squeakland at squeakland.org
> http://lists.squeakland.org/mailman/listinfo/squeakland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakland.org/pipermail/squeakland/attachments/20111017/f08f75dd/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AnimateTiles.001.pr
Type: application/octet-stream
Size: 120331 bytes
Desc: not available
URL: <http://lists.squeakland.org/pipermail/squeakland/attachments/20111017/f08f75dd/attachment-0001.obj>

More information about the squeakland mailing list