Etoys-
I have a 'turtle' with a reset button (clears screen, sets position to random xy) and a drawpattern script with random colors. Can I create many copies of this turtle and run all the resets at once - re-positions all 'turtles' and clears the screen, and then run drawpattern all at once for all turtles? Note that drawpattern needs to run only once, not constantly as with a timer. Thanks, Randy Latimer _______________________________________________ squeakland mailing list [hidden email] http://lists.squeakland.org/mailman/listinfo/squeakland |
So from what I can tell about what you are trying to do the best way may be to create "sibling copies" or your turtles. This is done by either holding down the shift key when you click on the copy icon in the halo or from the menu in the halo there is an option to create siblings
That said there are a number of ways to reset things I can think of and hopefully this is not too much info:
Stephen On Sun, Aug 28, 2011 at 10:41 PM, R.D. Latimer <[hidden email]> wrote: Etoys- _______________________________________________ squeakland mailing list [hidden email] http://lists.squeakland.org/mailman/listinfo/squeakland |
Thanks - I got #2 below to work. I put all the turtle objects onto a playfield and use "tell all contents".
For #1, I guess I have to specifically call each turtle object reset, so if there are 10 turtles, I'll need 10 blocks, one for each turtle reset? It'd be nice to somehow loop through a list of turtle objects, saying to each one 'reset'. I tried this with the "Holder" - put turtle tiles for each turtle in the holder, then use "Holder send to all" or "Holder tell all contents" to reset. THat didn't seem to have any affect. 1 In NetLogo, you write a procedure named 'reset', then use 'tell all' for something like tell all turtles [ reset ] (I forget the exact syntax) #3 locked up for my version. Each turtle has a reset script. Each turtle is a sibling of the first turtle. When I use tell all siblings 'reset', the program locked up. I may be doing something wrong on that. Do I use turtle 1 to create all the siblings, turtle1 for sibling1, sibling 1 for sibling2, sibling2 for sibling3, etc. Also, to set random pen color, I used an indirect way I found someone suggested online. I don't think I can assign pencolor a random color. I made an object, assigned it random rgb amounts (1-100?), then assigned the pen color to be the color of that object. Randy On Sun, Aug 28, 2011 at 11:11 PM, Steve Thomas <[hidden email]> wrote:
_______________________________________________ squeakland mailing list [hidden email] http://lists.squeakland.org/mailman/listinfo/squeakland |
Also -
Recursion works - (I think) I made a drawsquare with 1 input for a counter, If number < 4 forward 100 rt 100 drawsquare (number + 1) recursive call. That's nice that recursion looks like it's supported. When I make an input, using 'number' for example, can I change the name to 'counter'? I think I have to use the default name provided by etoys - 'number' Randy
On Mon, Aug 29, 2011 at 6:42 AM, R.D. Latimer <[hidden email]> wrote: Thanks - I got #2 below to work. I put all the turtle objects onto a playfield and use "tell all contents". _______________________________________________ squeakland mailing list [hidden email] http://lists.squeakland.org/mailman/listinfo/squeakland |
In reply to this post by R.D. Latimer
On Mon, Aug 29, 2011 at 12:42 PM, R.D. Latimer <[hidden email]> wrote: Thanks - I got #2 below to work. I put all the turtle objects onto a playfield and use "tell all contents". Siblings can be made from other siblings in no specific order.
Could you post the project that locks up so I can see if I find whats going wrong ?
Yes, this is the only way to set the pen color from scripts. Karl
_______________________________________________ squeakland mailing list [hidden email] http://lists.squeakland.org/mailman/listinfo/squeakland |
Free forum by Nabble | Edit this page |