Clark+and+Grebl

Events

 * **When** **is clicked on** **button.button** ||
 * **Do:** || || **world.yourHorse** || ||


 * **While the world is running** ||
 * **Begin:** || ||  || ||
 * **During:** || || **world.horse2** || ||
 * **End:** || ||  || ||


 * **While the world is running** ||
 * **Begin:** || ||  || ||
 * **During:** || || **world.horse3** || ||
 * **End:** || ||  || ||


 * **While the world is running** ||
 * **Begin:** || ||  || ||
 * **During:** || || **world.findWinner** || ||
 * **End:** || ||  || ||


 * **When** **is clicked on** **lever.mount** ||
 * **Do:** || || **world.alienAttack** || ||

Methods

 * **world.yourHorse** **distance** **=** **1** **,** **distance2** **=** **1** **,** **random** **=** **1** ||
 * |||||||||| **Do in order** ||
 * ^  ||   |||||||| **//** **Finds distance** |||||||| **distance** **set** **value** **to** ( **raceLanes.racehorse1** **distance to** **cube** ) |||||||| **distance2** **set** **value** **to** ( **raceLanes.racehorse1** **distance to** **cube** ) |||||||| **random** **set** **value** **to** ( **random number** minimum = **0** maximum = **1** ) |||||||| **Do together** ||   |||||| **If** ( **distance2** **>=** **distance** ) ||   |||| **raceLanes.racehorse1** **move** **backward** **random** meters |||| **raceLanes.racehorse2** **move** **backward** **0.5** meters |||| **raceLanes.racehorse3** **move** **backward** **0.56** meters |||||| **Else** ||   |||| **//** **Do Nothing** |||||| **If** ( **distance2** **<=** **1** ) ||   |||| **Do together** ||   || **raceLanes.racehorse1** **set** **opacity** **to** **0 (0%)** style = **abruptly** duration = **0** seconds || **raceLanes.racehorse4** **set** **opacity** **to** **1 (100%)** style = **abruptly** duration = **0** seconds |||||| **Else** ||   |||| **//** **Do Nothing** ||


 * **world.horse2** **distance** **=** **1** **,** **distance2** **=** **1** **,** **random** **=** **1** ||
 * |||||||||| **Do in order** ||
 * ^  ||   |||||||| **distance** **set** **value** **to** ( **raceLanes.racehorse2** **distance to** **cube2** ) |||||||| **distance2** **set** **value** **to** ( **raceLanes.racehorse2** **distance to** **cube2** ) |||||||| **random** **set** **value** **to** ( **random number** minimum = **0** maximum = **1** ) |||||||| **Do together** ||   |||||| **If** ( **distance2** **<=** **1** ) ||   |||| **Do together** ||   || **raceLanes.racehorse3** **set** **opacity** **to** **0 (0%)** style = **abruptly** duration = **0** seconds || **raceLanes.racehorse6** **set** **opacity** **to** **1 (100%)** style = **abruptly** duration = **0** seconds |||||| **Else** ||   |||| //Do Nothing// ||


 * **world.horse3** **distance** **=** **1** **,** **distance2** **=** **1** **,** **random** **=** **1** ||
 * |||||||||| **Do in order** ||
 * ^  ||   |||||||| **distance** **set** **value** **to** ( **raceLanes.racehorse3** **distance to** **cube2** ) |||||||| **distance2** **set** **value** **to** ( **raceLanes.racehorse3** **distance to** **cube2** ) |||||||| **random** **set** **value** **to** ( **random number** minimum = **0** maximum = **1** ) |||||||| **Do together** ||   |||||| **If** ( **distance2** **<=** **1** ) ||   |||| **Do together** ||   || **raceLanes.racehorse2** **set** **opacity** **to** **0 (0%)** style = **abruptly** duration = **0** seconds || **raceLanes.racehorse5** **set** **opacity** **to** **1 (100%)** style = **abruptly** duration = **0** seconds |||||| **Else** ||   |||| //Do Nothing// ||


 * **world.findWinner** **past1** **=** **1** **,** **past2** **=** **1** **,** **past3** **=** **1** **,** **horses** **=** **,** **finished** **=** **1** ||
 * |||||||||||| **While** ( **finished** **==** **1** ) ||
 * ^  ||   |||||||||| **Loop** **infinity** times **times** ||
 * ^  ||^   ||   |||||||| **Do together** ||
 * ^  ||^   ||^   ||   |||||| **past1** **set** **value** **to** ( **raceLanes.racehorse1** **distance in front of** **cube** ) |||||| **past2** **set** **value** **to** ( **raceLanes.racehorse2** **distance in front of** **cube2** ) |||||| **past3** **set** **value** **to** ( **raceLanes.racehorse3** **distance in front of** **cube3** ) |||||||| **Do together** ||   |||||| **If** ( **past3** **<** **0** ) ||   |||| **finished** **set** **value** **to** **2** |||| **You Lost** **set** **opacity** **to** **1 (100%)** |||| **Loop** **infinity** times **times** ||   || **You Won** **set** **opacity** **to** **0 (0%)** duration = **0** seconds style = **abruptly** |||||| **Else** ||   |||| //Do Nothing// |||||| **If** ( **past1** **<** **0** ) ||   |||| **finished** **set** **value** **to** **2** |||| **You Won** **set** **opacity** **to** **1 (100%)** |||| **Loop** **infinity** times **times** ||   || **You Lost** **set** **opacity** **to** **0 (0%)** duration = **0** seconds style = **abruptly** |||||| **Else** ||   |||| //Do Nothing// |||||| **If** ( **past2** **<** **0** ) ||   |||| **finished** **set** **value** **to** **2** |||| **You Lost** **set** **opacity** **to** **1 (100%)** |||| **Loop** **infinity** times **times** ||   || **You Won** **set** **opacity** **to** **0 (0%)** duration = **0** seconds style = **abruptly** |||||| **Else** ||   |||| //Do Nothing// ||


 * **world.alienAttack**
 * distanceToCenterPoint** **=** **1** **,** **lightColor** **=** **,** **distance** **=** **1** ||
 * |||||||||| **lever.mount** **turn** **backward** **0.25** revolutions |||||||||| **lever** **play sound** **lever.45_Police_Siren (0:25.884)** |||||||||| **Do together** ||  |||||||| **alienShip** **set** **isShowing** **to** **true** duration = **0** seconds |||||||| **alienEyes** **set** **isShowing** **to** **true** duration = **0** seconds |||||||| **alienRing** **set** **isShowing** **to** **true** duration = **0** seconds |||||||| **camera** **set point of view to** **alien** |||||||| **distance** **set** **value** **to** ( **random number** ) |||||||||| **Loop** **infinity** times **times** ||   |||||||| **Do together** ||   |||||| **Loop** **infinity** times **times** ||   |||| **distanceToCenterPoint** **set** **value** **to** ( **alienShip** **distance to** **alienCenterPoint** ) |||| **Do together** ||   || **alienShip** **turn to face** **alienCenterPoint** style = **abruptly** duration = **0.5** seconds || **alienShip** **move** **forward** **5** meters duration = **0.5** seconds style = **abruptly** || **world** **set** **atmosphereColor** **to** **random item from** **lightColor** duration = **0.5** seconds || **world** **set** **ambientLightColor** **to** **random item from** **lightColor** duration = **0.5** seconds || **world** **set** **ambientLightBrightness** **to** **distance** ||