Return to site

Algodoo file download amazing marble race

broken image

_l = _change(_l, e.other._num - 1, _cir) //Change the value of _l, so that when other marbles of the color reached, we can get the entity of the marble holder asapĮ.other.pos = (scene.entitybyid(_cir)).pos //Teleport the marble to the marble holder _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

broken image

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.

broken image

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