Anthony+Marx

Here Come the Fuzz! 2.0

Breif instructions: drive with arrow keys if you get within 5m from the cop car he will start chasing you. run.



Code

=CarChaseCode's Code= =Created by: Anthony marx=

Events

 * **When the world starts** ||
 * **Do:** ||  || **world.my first method** ||   ||


 * Let move car ||

Methods

 * **world.my first method**
 * distanceToCar** **=** **1** ||
 * |||||||||| **Do in order** ||
 * ^  ||   |||||||| **Loop** **infinity** times **times** ||
 * ^  ||^   ||   |||||| **distanceToCar** **set** **value** **to** ( **car** **distance to** **policeCar** ) ||
 * ^  ||^   ||^   |||||| **If** ( **distanceToCar** **<=** **5** ) ||
 * ^  ||^   ||^   ||   |||| **Wait** **1** second ||
 * ^  ||^   ||^   ||^   |||| **Do together** ||
 * ^  ||^   ||^   ||^   ||   || **world.copChase** ||
 * ^  ||^   ||^   ||^   |||| // **if the car is within 5m of cop car it chases** // ||
 * ^  ||^   ||^   |||||| **Else** ||
 * ^  ||^   ||^   ||   |||| Do Nothing// ||


 * **world.copChase**
 * distanceToCar** **=** **1** ||
 * |||||||| **Do in order** ||
 * ^  ||   |||||| **distanceToCar** **set** **value** **to** ( **policeCar** **distance to** **car** ) ||
 * ^  ||^   |||||| **Loop** **infinity** times **times** ||
 * ^  ||^   ||   |||| **Do together** ||
 * ^  ||^   ||^   ||   || **policeCar** **point at** **car** style = **abruptly** onlyAffectYaw = **true** duration = **1** second ||
 * ^  ||^   ||^   ||^   || **policeCar** **move** **forward** ( **(** **distanceToCar** **-** **0.25** **)** ) duration = **1** second style = **abruptly** ||
 * ^  ||^   ||^   ||^   || **//** **durration controlls speed of cop car** ||


 * **world.cop2Chase**
 * distanceToCar** **=** **1** ||
 * |||||||| **Do in order** ||
 * ^  ||   |||||| **distanceToCar** **set** **value** **to** ( **policeCar2** **distance to** **car** ) ||
 * ^  ||^   |||||| **Loop** **infinity** times **times** ||
 * ^  ||^   ||   |||| **Do together** ||
 * ^  ||^   ||^   ||   || **policeCar2** **point at** **car** style = **abruptly** onlyAffectYaw = **true** duration = **1** second ||
 * ^  ||^   ||^   ||^   || **policeCar2** **move** **forward** ( **(** **distanceToCar** **-** **0.25** **)** ) duration = **1** second style = **abruptly** ||


 * **world.cop3Chase**
 * distanceToCar** **=** **1** ||
 * |||||||| **Do in order** ||
 * ^  ||   |||||| **distanceToCar** **set** **value** **to** ( **policeCar3** **distance to** **car** ) ||
 * ^  ||^   |||||| **Loop** **infinity** times **times** ||
 * ^  ||^   ||   |||| **Do together** ||
 * ^  ||^   ||^   ||   || **policeCar3** **point at** **car** style = **abruptly** onlyAffectYaw = **true** duration = **1** second ||
 * ^  ||^   ||^   ||^   || **policeCar3** **move** **forward** ( **(** **distanceToCar** **-** **0.25** **)** ) duration = **1** second style = **abruptly** ||