Stats: Turn 15, Turtles 2;
Name ; Rule ; Active?
- speed-> @forward 1-> @type == 'bullet'
- activateGun-> @clone type: 'bullet', color: 'red'-> @type == 'crazy' and sim.time % 8 == 0
- wobble->
@rotateLeft tau / 16 * (Math.random() - 0.5)
@forward 0.25-> @type == 'crazy'
- patchHere-> sim.patches[Math.floor(@x)][Math.floor(@y)]-> false
- layGrass-> @patchHere().grass += 5-> true
- decayGrass-> @grass *= 0.99-> true
- diffuseGrass-> @diffuse4 'grass', (patch1) -> patch1.grass / 10 / (4+1)-> true
- setup->
sim.turtles = [sim.newTurtle(
{x:5, y:5, color:'rgb(88,88,88)', heading:0, type:'crazy'})]
patchcolor = ->
'rgb(127,'+(Math.floor Math.min 30*@grass, 255)+',127)'
sim.setAllPatches (x,y) ->
{color: patchcolor, grass:0}-> true
(https://github.com/idupree/Starplay)