something i discovered: emitters may have a limit to how much particles they can emit. in my code, i made it so that when the amount of particles reaches a specific number then a new emitter will be created. storing emitters and replacing them when they cant emit anymore is faster than making a new emitter every pixel.
This deck is script. Check this script:
local res = 8
local invres = 1/res
local wr, hr = 10*res, 14*res
local size = wr*hr
local hwr, hhr = wr/2, hr/2
local hwrr, hhrr = hwr/res, hhr/res
local pad = 0.5/res
local hwp, hhp = hwrr+pad, hhrr+pad
local whwp = 10-hwp
local ihwp, ihhp = invres-hwp, invres-hhp
local pn = castle.particles.new
local pixp = {
blueprint="Drawing", --this blueprint does not exist, but it gives the cleanest square that noone can replicate (i assume)
emitRate=0,
lifetime={1000,1000},
speed={0,0},
spread=0,
sizes={1/res,1/res},
colors={{0,0,0,1}},
gravity={0,0}
}
table.freeze(pixp.lifetime)
table.freeze(pixp.speed)
table.freeze(pixp.sizes)
table.freeze(pixp.gravity)
table.freeze(pixp)
local rgb = pixp.colors[1]
local what = true
local pA = {}
local pB = {}
local dA = {}
local dB = {}
local dAl, dBl = 0,0
local cA = {}
local cB = {}
local screen = {}
for i = 0,255 do
rgb[1], rgb[2], rgb[3] = i/255,i/255,i/255
pA[i] = pn(pixp)
pB[i] = pn(pixp)