top of page

After I was inspired by Stewart Feasby's use of local variables in his Clone Commander Project, I realized that clones can have seperate variables associated with them.  A global list can then be used to to store these properties and would allow for clones to interact with each other.  In order to do this however, clones must have a variable storing its location the this list so that it knows which one to update its properties, such as direction, whenever the are changed.

By using the previous clone as a kind of "parent" clone, a clone can calculate its position based off the direction and length of it's parent using vector addition (which is just basic trignometry).  The next clone, and every clone after that can then use the same the process to determine its location.

 

Later on, I added an additional variable to store the location of which clone in the list to be used as the parent.  This allows for the tree structures in my next project:

Scratch Data Structures

Linked Lists

A pose-able snake made up one one sprite and clones. Press space to add joints and click and drag parts to rotate them.

 

For best results, run in turbo mode!

 

In a more technical sense, the snake consists of a structure comparable to a "linked list" Each clone references the position and the direction of the last to calculate its own position, allowing for a snake of any length (in theory).

 

 

Inspired by the mechanics of feasby007's Clone Commander:

http://scratch.mit.edu/projects/16113008

 

Linked lists onWikipedia:

http://en.wikipedia.org/wiki/Linked_list

 

Scratch Link

http://scratch.mit.edu/projects/17085354/

Here are some interesting data structures that I emulated in Scratch.
Check out my full Scratch profile here for my other projects.

 

Trees

A pose-able tree made up one one sprite and clones. Hover you mouse over a branch and press space to add branches. Then, click and drag parts to rotate them. Also, press 1, 2 or 3 while hovering over a branch to change its length (and costume).

For best results, run in turbo mode!

In a more technical sense, the tree consists of a data structure comparable to a "tree" Each clone references the position and the direction of it's parent branch to calculate its own position, allowing for a tree of any size (in theory).

 

Inspired by the mechanics of feasby007's Clone Commander:

http://scratch.mit.edu/projects/16113008

 

Trees (the data structure) on Wikipedia:

http://en.wikipedia.org/wiki/Tree_(data_structure)

 

Related project with linked lists:

http://scratch.mit.edu/projects/17085354/

With this extra variable, clones can reference any other clone in the list to be considered as a parent.  However, several other issues occur when it comes to the operations of deleting and inserting nodes sinces this is only a singlely linked structure.  Nodes only have a reference to their parent, but not of thier children.  Perhaps a solution would be to have a local list for each node that stores references to its chidren.  

bottom of page