This system allows for pixels with a maximum period of 5, with lower periods also supported. As explained before, each cell holds one colour alongside the display colour, which is shared among all four cells in the pixel; additionally each cell stores whether it is the top left cell in the pixel or not (this information is necessary for pixels to have, as it allows them to deduce which pixel they belong to). Also, ther are extra "filler" states which do not store a second colour. These let one choose the desired period of the pixel. In total, there are therefore 2n²+n states for n colours; the maximum number of colours that can therefore be used in a Golly implementation is 11, with 253 states in total.
But how do you use such a rule for creating animated pixel art? Let's assume you want to recreate these four example patterns, which simply display a number counting up from 1 to 5, 4, 3 and 2 respectively:
Code: Select all
x = 74, y = 18, rule = AnimatedPixelArt
pJuOpJuOpJuOpJuOpJuOpJuOpJuO6.pJBpJBpJBpJBpJBpJBpJB6.pJBpJBpJBpJBpJBpJ
BpJB6.pJBpJBpJBpJBpJBpJBpJB$uPuQuPuQuPuQuPuQuPuQuPuQuPuQ6.uPuQuPuQuPuQ
uPuQuPuQuPuQuPuQ6.uPBuPBuPBuPBuPBuPBuPB6.14B$pJuOKtLKtLKtLKtLKtLpJuO
6.pJBK.K.K.K.K.pJB6.pJBK.K.K.K.K.pJB6.pJBK.K.K.K.K.pJB$uPuQ10tLuPuQ6.
uPuQ10tLuPuQ6.uPBtL.tL.tL.tL.tL.uPB6.2B10.2B$pJuOKtLOtVpXvGOtVKtLpJuO
6.pJBK.O.pXCO.K.pJB6.pJBK.O.pXCO.K.pJB6.pJBK.O.pXCO.K.pJB$uPuQ2tLtTtU
vEuUtTtU2tLuPuQ6.uPuQ2tLtTtUvEuUtTtU2tLuPuQ6.uPBtL.tT.vECtT.tL.uPB6.
2B4.2C4.2B$pJuOKtLpTvGpTuUOtLKtLpJuO6.pJBK.pTCpTCO.K.pJB6.pJBK.pTCpTC
O.K.pJB6.pJBK.pTCpTCO.K.pJB$uPuQ2tLuUvF2uUtTtU2tLuPuQ6.uPuQ2tLuUvF2uU
tTtU2tLuPuQ6.uPBtL.uUCuUCtT.tL.uPB6.2B2.4C4.2B$pJuOKtLOtVpXvGOtVKtLpJ
uO6.pJBK.O.pXCO.K.pJB6.pJBK.O.pXCO.K.pJB6.pJBK.O.pXCO.K.pJB$uPuQ2tLtT
tUvEvFtTtU2tLuPuQ6.uPuQ2tLtTtUvEvFtTtU2tLuPuQ6.uPBtL.tT.vECtT.tL.uPB
6.2B4.2C4.2B$pJuOKtLOtLpTuUKtVKtLpJuO6.pJBK.O.pTCK.K.pJB6.pJBK.O.pTCK
.K.pJB6.pJBK.O.pTCK.K.pJB$uPuQ4tL2uUtTtU2tLuPuQ6.uPuQ4tL2uUtTtU2tLuPuQ
6.uPBtL.tL.uUCtT.tL.uPB6.2B4.2C4.2B$pJuOKtLpXvGpXvGpXvGKtLpJuO6.pJBK.
pXCpXCpXCK.pJB6.pJBK.pXCpXCpXCK.pJB6.pJBK.pXCpXCpXCK.pJB$uPuQ2tLvEuUvE
uUvEvF2tLuPuQ6.uPuQ2tLvEuUvEuUvEvF2tLuPuQ6.uPBtL.vECvECvECtL.uPB6.2B
2.6C2.2B$pJuOKtLKtLKtLKtLKtLpJuO6.pJBK.K.K.K.K.pJB6.pJBK.K.K.K.K.pJB
6.pJBK.K.K.K.K.pJB$uPuQ10tLuPuQ6.uPuQ10tLuPuQ6.uPBtL.tL.tL.tL.tL.uPB
6.2B10.2B$pJuOpJuOpJuOpJuOpJuOpJuOpJuO6.pJBpJBpJBpJBpJBpJBpJB6.pJBpJB
pJBpJBpJBpJBpJB6.pJBpJBpJBpJBpJBpJBpJB$uPuQuPuQuPuQuPuQuPuQuPuQuPuQ6.
uPuQuPuQuPuQuPuQuPuQuPuQuPuQ6.uPBuPBuPBuPBuPBuPBuPB6.14B!
Code: Select all
x = 2, y = 2, rule = AnimatedPixelArt
KtL$2tL!
Next up, we need to enter the colours that we want to be present in each frame on each pixel. The rule has some very handy properties to simplify this process, and allows you to fill all frames one by one simply by changing the top left cell to one with the desired colour stored in it. Be careful however to only change the top left cell, and always change it to another top left cell! As a useful guide, the top left cell always features a white dot in the middle, while the other three corner cells feature a plus shape. The safest bet is to always use cells with state 11-21 for this.
After filling in all top left cells, the result should look something like this:
Code: Select all
x = 14, y = 18, rule = AnimatedPixelArt
MtLMtLMtLMtLMtLMtLMtL$14tL$MtLKtLKtLKtLKtLKtLMtL$14tL$MtLKtLKtLNtLKtL
KtLMtL$14tL$MtLKtLNtLNtLKtLKtLMtL$14tL$MtLKtLKtLNtLKtLKtLMtL$14tL$MtL
KtLKtLNtLKtLKtLMtL$14tL$MtLKtLNtLNtLNtLKtLMtL$14tL$MtLKtLKtLKtLKtLKtL
MtL$14tL$MtLMtLMtLMtLMtLMtLMtL$14tL!
Code: Select all
x = 14, y = 18, rule = AnimatedPixelArt
pIuJpIuJpIuJpIuJpIuJpIuJpIuJ$14uJ$pIuJKtLKtLKtLKtLKtLpIuJ$2uJ10tL2uJ$
pIuJKtLKtLpTuUKtLKtLpIuJ$2uJ4tL2uU4tL2uJ$pIuJKtLpTuUpTuUKtLKtLpIuJ$2uJ
2tL4uU4tL2uJ$pIuJKtLKtLpTuUKtLKtLpIuJ$2uJ4tL2uU4tL2uJ$pIuJKtLKtLpTuUK
tLKtLpIuJ$2uJ4tL2uU4tL2uJ$pIuJKtLpTuUpTuUpTuUKtLpIuJ$2uJ2tL6uU2tL2uJ$
pIuJKtLKtLKtLKtLKtLpIuJ$2uJ10tL2uJ$pIuJpIuJpIuJpIuJpIuJpIuJpIuJ$14uJ!
Next up, entering the second frame is as easy as the first. As the top left cell's display colour isn't actually used to store any information, we can now enter all pixels the same way as before using cells with state 11-21. If we now advance again, we are able to see something quite interesting.
Code: Select all
x = 14, y = 18, rule = AnimatedPixelArt
VuAVuAVuAVuAVuAVuAVuA$14tW$VuAKtLKtLKtLKtLKtLVuA$2tW10tL2tW$VuAKtLqGvH
qGvKqGvHKtLVuA$2tW2tL6vH2tL2tW$VuAKtLKtOKtOqGvHKtLVuA$2tW6tL2vH2tL2tW
$VuAKtLqGvHqGvKqGvHKtLVuA$2tW2tL6vH2tL2tW$VuAKtLqGvHKtOKtLKtLVuA$2tW
2tL2vH6tL2tW$VuAKtLqGvKqGvKqGvKKtLVuA$2tW2tL6vH2tL2tW$VuAKtLKtLKtLKtL
KtLVuA$2tW10tL2tW$VuAVuAVuAVuAVuAVuAVuA$14tW!
We can now ener the remaining frames, resulting in this final pattern.
Code: Select all
x = 14, y = 18, rule = AnimatedPixelArt
qTwBqTwBqTwBqTwBqTwBqTwBqTwB$vTwAvTwAvTwAvTwAvTwAvTwAvTwA$qTwBKtLKtLK
tLKtLKtLqTwB$vTwA10tLvTwA$qTwBKtLtAyKtDyBtAyKKtLqTwB$vTwA2tLyFyJyFyJyF
yJ2tLvTwA$qTwBKtLtDyKNtLKtUKtLqTwB$vTwA2tL2yB2tLtPtT2tLvTwA$qTwBKtLtA
yKtDyKtAyKKtLqTwB$vTwA2tLyFyJyFyJyFyJ2tLvTwA$qTwBKtLKtLNtLtAyKKtLqTwB
$vTwA2tLtP3tLyByJ2tLvTwA$qTwBKtLtDyBtDyBtDyKKtLqTwB$vTwA2tLyFyJyFyJyF
yJ2tLvTwA$qTwBKtLKtLKtLKtLKtLqTwB$vTwA10tLvTwA$qTwBqTwBqTwBqTwBqTwBqT
wBqTwB$vTwAvTwAvTwAvTwAvTwAvTwAvTwA!
The pattern with period 4 is made in a very similar manner to that with period 5, but the base pixel structure is slightly different. Instead of having a state 132 cell in the top right corner, we use a state 0 cell instead. This is one of the "filler cells" from above, which doesn't store a frame of its own.
Code: Select all
x = 2, y = 2, rule = AnimatedPixelArt
K$2tL!
Code: Select all
x = 14, y = 18, rule = AnimatedPixelArt
K.K.K.K.K.K.K$14tL$K.K.K.K.K.K.K$14tL$K.K.K.K.K.K.K$14tL$K.K.K.K.K.K.
K$14tL$K.K.K.K.K.K.K$14tL$K.K.K.K.K.K.K$14tL$K.K.K.K.K.K.K$14tL$K.K.K
.K.K.K.K$14tL$K.K.K.K.K.K.K$14tL!
Code: Select all
x = 14, y = 18, rule = AnimatedPixelArt
rRGrRGrRGrRGrRGrRGrRG$wRwWwRwWwRwWwRwWwRwWwRwWwRwW$rRGK.K.K.K.K.rRG$wR
wW10tLwRwW$rRGK.sNIN.sNIK.rRG$wRwW2tLxSxWtPtTxSxW2tLwRwW$rRGK.sQIN.sN
IK.rRG$wRwW2tL2xO2tLxSxW2tLwRwW$rRGK.sNIsQIsNIK.rRG$wRwW2tLxSxWxSxWxS
xW2tLwRwW$rRGK.K.N.sNIK.rRG$wRwW2tLtP3tLxOxW2tLwRwW$rRGK.N.N.sQIK.rRG
$wRwW2tLtPtTtPtTxSxW2tLwRwW$rRGK.K.K.K.K.rRG$wRwW10tLwRwW$rRGrRGrRGrR
GrRGrRGrRG$wRwWwRwWwRwWwRwWwRwWwRwWwRwW!
Code: Select all
x = 2, y = 2, rule = AnimatedPixelArt
K$tL!
Code: Select all
x = 14, y = 18, rule = AnimatedPixelArt
14K$14tL$14K$14tL$14K$14tL$14K$14tL$14K$14tL$14K$14tL$14K$14tL$14K$
14tL$14K$14tL!
Code: Select all
x = 14, y = 18, rule = AnimatedPixelArt
K.K.K.K.K.K.K$tL.tL.tL.tL.tL.tL.tL$K.K.K.K.K.K.K$tL.tL.tL.tL.tL.tL.tL
$K.K.K.K.K.K.K$tL.tL.tL.tL.tL.tL.tL$K.K.K.K.K.K.K$tL.tL.tL.tL.tL.tL.tL
$K.K.K.K.K.K.K$tL.tL.tL.tL.tL.tL.tL$K.K.K.K.K.K.K$tL.tL.tL.tL.tL.tL.tL
$K.K.K.K.K.K.K$tL.tL.tL.tL.tL.tL.tL$K.K.K.K.K.K.K$tL.tL.tL.tL.tL.tL.tL
$K.K.K.K.K.K.K$tL.tL.tL.tL.tL.tL.tL!
Code: Select all
x = 14, y = 18, rule = AnimatedPixelArt
rGFrGFrGFrGFrGFrGFrGF$wGFwGFwGFwGFwGFwGFwGF$rGFK.K.K.K.K.rGF$wGFtL.tL
.tL.tL.tL.wGF$rGFK.sCHsFHsCHK.rGF$wGFtL.xHHxHHxHHtL.wGF$rGFK.N.N.sCHK
.rGF$wGFtL.tL.tL.xHHtL.wGF$rGFK.sCHsFHsCHK.rGF$wGFtL.xHHxHHxHHtL.wGF$
rGFK.K.N.sCHK.rGF$wGFtL.tP.tL.xDHtL.wGF$rGFK.sFHsFHsFHK.rGF$wGFtL.xHH
xHHxHHtL.wGF$rGFK.K.K.K.K.rGF$wGFtL.tL.tL.tL.tL.wGF$rGFrGFrGFrGFrGFrG
FrGF$wGFwGFwGFwGFwGFwGFwGF!
Code: Select all
x = 14, y = 18, rule = AnimatedPixelArt
XAXAXAXAXAXAXA$14A$XAK.K.K.K.K.XA$2A10.2A$XAK.qGDqJDqGDK.XA$2A2.6D2.
2A$XAK.N.N.qGDK.XA$2A6.2D2.2A$XAK.qGDqJDqGDK.XA$2A2.6D2.2A$XAK.qGDN.K
.K.XA$2A2.2D6.2A$XAK.qJDqJDqJDK.XA$2A2.6D2.2A$XAK.K.K.K.K.XA$2A10.2A$
XAXAXAXAXAXAXA$14A!
Waiting to see what you can come up with.