Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Langton's Ant W.I.P. by DayTimer253
- -- Modified by Matera_the_Mad just for shiggles
- siden = 1
- side = 1
- local ENT = elements.allocate("DLI", "ENT")
- elements.element(ENT, elements.element(elements.DEFAULT_PT_PROT))
- elements.property(ENT, "Name" , "ENT")
- elements.property(ENT, "Description" , "Default Langton's ENT. Changes elements above it to air, rotates 90* and moves forward, else rotates -90* and changes air to GOO, BCLN, WOOD, or VINE. DO NOT PLACE MORE THAN 1!")
- elements.property(ENT, "Color", 0x99FF66)
- elements.property(ENT, "Diffusion", 0)
- elements.property(ENT, "Weight", 0)
- elements.property(ENT, "MenuSection", 12)
- elements.property(elements.DLI_PT_ENT, "Update",
- function(i,x,y,s,nt)
- siden = side
- sim.partProperty(i, "y", y-1) --to test particles under it
- sim.partProperty(i, "x", x-1)
- if siden == 4 then
- local px,py = 0,0
- px,py = x, y
- if sim.partID(px,py) == 0 then
- tpt.create(px,py,"VINE")
- sim.partProperty(i, "x", px+1)-- +
- side=1
- else
- sim.partKill(sim.partID(px,py))
- side=3
- sim.partProperty(i, "x", px-1)-- -
- end end
- if siden == 3 then
- local px,py = 0,0
- px,py = x, y
- if sim.partID(px,py) == 0 then
- tpt.create(px,py,"WOOD")
- sim.partProperty(i, "y", py+1)
- side=4
- else
- sim.partKill(sim.partID(px,py))
- side=2
- sim.partProperty(i, "y", py-1)
- end end
- if siden == 2 then
- local px,py = 0,0
- px,py = x, y
- if sim.partID(px,py) == 0 then
- tpt.create(px,py,"BCLN")
- sim.partProperty(i, "x", px-1)-- -
- side=3
- else
- sim.partKill(sim.partID(px,py))
- side=1
- sim.partProperty(i, "x", px+1)-- +
- end end
- if siden == 1 then
- local px,py = 0,0
- px,py = x, y
- if sim.partID(px,py) == 0 then
- tpt.create(px,py,"GOO")
- sim.partProperty(i, "y", py-1)
- side=2
- else
- sim.partKill(sim.partID(px,py))
- side=4
- sim.partProperty(i, "y", py+1)
- end
- sim.partProperty(i,"y", y+1) --testing particle under it
- sim.partProperty(i, "x", x+1)
- end
- end
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement