Happy New Year to all friends in TEX.SX.
This code stands on the ideas from Cmhughes and Bloodworks. I am disappointed that latex isn't allowing me to add sound:
\documentclass{article}
\usepackage{filecontents}%
\begin{filecontents*}{beam.tex}
\documentclass[tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing,decorations.shapes,backgrounds}
\begin{document}
\foreach \radius in {1,2,...,20}
{
\begin{tikzpicture}
% background rectangle
\filldraw[black] (-3,-3) rectangle (5,3);
\pgfmathparse{100-(\radius)};
\foreach \x in {-2,-.5,2.3,4}{
\pgfmathrandominteger{\y}{0}{2.9}
\node[xshift=5*rnd,blue!\pgfmathresult!white,scale={.8*rnd}]at (\x,\y){$\star$};
}
\ifnum\radius<4
\pgfmathparse{100-(\radius)*4};
\draw[blue!\pgfmathresult!black,decorate, decoration={random steps,segment length=3pt,amplitude=.5pt},ultra thin] (0.5 , -2.9)--(0,0);
\fi
\ifnum\radius<11
\pgfmathparse{100-(\radius-1)*10};
\fill[shading=radial, inner color=white!\pgfmathresult!black, outer color=black, opacity=.8](0,0) circle (\radius mm -2mm);
\foreach \angle in {0,10,...,360}
{
\draw[red!\pgfmathresult!black,,decorate, decoration={random steps,segment length=1pt,amplitude=.3pt}] (0,0) -- (\angle:\radius mm)node[white!\pgfmathresult!blue, yshift=-.1mm,scale=.35*rnd]{*};
}
\fi
%%%
\ifnum\radius>5
\ifnum\radius<10
\pgfmathparse{100-(\radius)*4};
\draw[xshift=1cm,yshift=1cm,red!\pgfmathresult!black,decorate, decoration={random steps,segment length=3pt,amplitude=.5pt},ultra thin] (1 , -3.9)--(0,0);
\fi\fi
\ifnum\radius>5
\pgfmathparse{100-(\radius-6)*7};
\fill[xshift=1cm,yshift=1cm,shading=radial, inner color=white!\pgfmathresult!black, outer color=black, opacity=.8](0,0) circle (\radius mm -9mm);
\foreach \angle in {0,20,...,360}
{
\draw[xshift=1cm,yshift=1cm,orange!\pgfmathresult!black,decorate, decoration={random steps,segment length=1pt,amplitude=.3pt}] (0,0) -- (\angle:\radius mm -4mm)node[white!\pgfmathresult!blue, yshift=-.1mm,scale=.5*rnd]{*};
}
\foreach \angle in {10,30,...,350}{
\draw[xshift=1cm,yshift=1cm,red!\pgfmathresult!black,decorate, decoration={random steps,segment length=1pt,amplitude=.5pt}] (0,0) -- (\angle:\radius mm -5mm)node[red!\pgfmathresult!black, yshift=-.1mm,scale=.5*rnd]{*};
}
\foreach \angle in {15,35,...,355}{
\draw[xshift=1cm,yshift=1cm,yellow!\pgfmathresult!black,decorate, decoration={random steps,segment length=1pt,amplitude=.5pt},opacity=.5] (0,0) -- (\angle:\radius mm -6mm)node[white!\pgfmathresult!black, yshift=-.1mm,scale=.5*rnd,opacity=1]{*};
}
\foreach \angle in {5,25,...,355}{
\draw[xshift=1cm,yshift=1cm,green!\pgfmathresult!black,decorate, decoration={random steps,segment length=1pt,amplitude=.5pt},opacity=.5] (0,0) -- (\angle:\radius mm -3mm)node[orange!\pgfmathresult!black, yshift=-.1mm,scale=.5*rnd,opacity=1]{*};
}
\fi
% yellow firework
\ifnum\radius>10
\ifnum\radius<14
\pgfmathparse{100-(\radius)*4};
\draw[xshift=3cm,yshift=1.5cm,blue!\pgfmathresult!black,decorate, decoration={random steps,segment length=3pt,amplitude=.5pt},ultra thin] (1 , -4.5)--(0,0);
\fi\fi
\ifnum\radius>10
\pgfmathparse{100-(\radius-1)*5};
\fill[xshift=3cm,yshift=1.5cm,shading=radial, inner color=green!\pgfmathresult!black, outer color=black, opacity=.8](0,0) circle (\radius mm -10mm);
\foreach \angle in {0,10,...,360}
{
\draw[xshift=3cm,yshift=1.5cm,yellow!\pgfmathresult!black,decorate, decoration={random steps,segment length=2pt,amplitude=.5pt},opacity=.5] (0,0) -- (\angle:\radius mm -8mm)node[orange!\pgfmathresult!black, yshift=-.1mm,scale=.8*rnd,opacity=1]{*};
}
\fi
% blue green firework
\ifnum\radius>10
\ifnum\radius<14
\pgfmathparse{100-(\radius)*4};
\draw[xshift=-1.5cm,yshift=1.5cm,green!\pgfmathresult!black,decorate, decoration={random steps,segment length=3pt,amplitude=.5pt},ultra thin] (-1, -4.5)--(0,0);
\fi\fi
\ifnum\radius>10
\pgfmathparse{100-(\radius-1)*5};
\fill[xshift=-1.5cm,yshift=1.5cm,shading=radial, inner color=yellow!\pgfmathresult!black, outer color=black, opacity=.8](0,0) circle (\radius mm -10mm);
\foreach \angle in {10,20,...,360}
{
\draw[xshift=-1.5cm,yshift=1.5cm,green!\pgfmathresult!black,decorate, decoration={random steps,segment length=2pt,amplitude=.5pt},opacity=.5] (0,0) -- (\angle:\radius mm -8mm)node[red!\pgfmathresult!black, yshift=-.1mm,scale=.8*rnd,opacity=1]{*};
}
\fi
\end{tikzpicture}
}
\end{document}
\end{filecontents*}
%create the beam.pdf.
\immediate\write18{pdflatex beam}
% convert to GIF animation
\immediate\write18{convert -delay 15 -loop 0 -density 200 -alpha remove beam.pdf beam.gif}
\begin{document}
Look for the beam.gif file in the same directory as this file.
\end{document}
Compile it with pdflatex and you should have installed imagemagick for generating .gif file.
