Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Just fixing bug with wrong testing system during 3 hours. I hate bugfixes...
- -- I just made a mess with formatting.
- siden = 1
- side = 1
- local ANT = elements.allocate("DLI", "ANT")
- elements.element(ANT, elements.element(elements.DEFAULT_PT_PROT))
- elements.property(ANT, "Name" , "ANT")
- elements.property(ANT, "Description" , "Default Langton's ant. Changes elements under it to air, rotates 90* and moves forward, else rotates -90* and changes air to FRME. DO NOT PLACE MORE THAN 1!")
- elements.property(ANT, "Color", 0x66cc66)
- elements.property(ANT, "Diffusion", 0)
- elements.property(ANT, "Weight", 0)
- elements.property(ANT, "MenuSection", 12)
- elements.property(elements.DLI_PT_ANT, "Update",
- function(i,x,y,s,nt)
- siden = side
- sim.partProperty(i, "y", y+1) --to test particles under it
- if siden == 4 then
- local px,py = 0,0
- px,py = x, y
- if sim.partID(px,py) == 0 then
- tpt.create(px,py,"FRME")
- 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,"FRME")
- 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,"FRME")
- 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,"FRME")
- 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
- end
- end
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement