[Squeakland] spiral

Phil Firsenbaum tacmanphil at mac.com
Sun Dec 12 20:07:23 PST 2004


Here are the attachments I referred to:
-------------- next part --------------



The most direct way of watching the value of y is to keep Birdie's 
viewer open. If you look in the Basic category, as Birdie moves you'll 
be able to see the values of its coordinates change.

To control the number of times a script is executed you probably want 
to create a variable (count) and then add a test to the script which 
waits for the value of the variable to reach a certain number, while 
someplace else in the script you increase the value of the variable 
each time the script is executed. If you're able to see the attached 
scripts, you'll see an example of a variable (size1) whose value 
increases as the script (spiral) is executed.

  Hope this makes sense.

Phil

On Dec 11, 2004, at 7:15 AM, Shashank Date wrote:

> Phil Firsenbaum wrote:
>
>> If you looked at the script, I have a test which looks to see when 
>> Birdie's y coordinate is < 100.
>
> I did not get the attachment and so could not look at the script. Is 
> the script available somwhere on the web?
>
>> When it is the script is paused and the drawing of the spiral stops.
>> In the running of the project Birdie begins in the center of the 
>> screen where its y coordinate is 390. As it moves out from the center 
>> y gets larger when it moves towards the top of the screen and smaller 
>> when it moves towards the bottom. I arbitrarily chose to look at the 
>> value of y when it's approaching the bottom of the screen.
>
> Oh, I see. I get the idea, but am still not sure how to "arbitrarily" 
> choose to look at the value. Are you using the "random" number?
>
>> Of course, there are other approaches one could take to stop the 
>> spiral...
>
> Yes, and the one I am interested in, is the one which allows us to 
> control the number of times a certain script gets executed... a 
> looping mechanism if you will.
>
>> Phil
>
> -- Shashank
>
>>
>> On Dec 9, 2004, at 6:06 PM, Shashank Date wrote:
>>
>>> Hello,
>>>
>>> Phil Firsenbaum wrote:
>>>
>>>> Randy,
>>>> I was playing with polygons and spirals last year and created the 
>>>> attached scripts. They use a variable (size1) for the length of the 
>>>> sides and I start Birdie in the center of the screen.
>>>
>>>
>>> Is there a way to limit the loops of the spiral to some finite 
>>> number,
>>> in eToys?
>>>
>>> Something like "repeat 10 times" (as in Logo)?
>>>
>>> Thanks,
>>> -- Shashank
>>>
>>>
>>>
>>>
>>
>>
>


More information about the Squeakland mailing list