Algodoo amazing marble race

broken image

_cir := eval('scene.my._circles' + (_n)) //Get the entityid of the marble holder we want _n = string.length(_islist) //Get the number of the marble holder we want to teleport the marble to _islist = _islist ++ //ADD THE MARBLE's NUM TO ISLIST IF THE COLOR REACHES THE END FOR THE FIRST TIME. Set the marble holders's onspawn to below: (e)=>) Give all marble holders a variable _num, and set the value according to the number of it, as shown below. The value of _num is determined by the color of the marble. :DĮach marble have a variable _num, below. There is also a short explanation at the comments. Later during the scripting part of the tutorial, if you don't understand what are the lists are for later, check the comments.

broken image