滑动拼图

滑动拼图

我想知道是否有可能用 Ti 编写一个非常简单的游戏Z;例如(很简单的)超级马里奥兄弟。马里奥是这样的:

\documentclass[border=5pt,tikz]{standalone}
\begin{document}
    \begin{tikzpicture}
        \draw[step=.5cm] (0,0) grid (8,8);
        \foreach \x in {2.5,3,...,4.5}
        {
            \fill[red] (\x,7.5) rectangle +(.5,.5);
        }
        \foreach \x in {2,2.5,...,6}
        {
            \fill[red] (\x,7) rectangle +(.5,.5);
        }
        \foreach \x in {2,2.5,3}
        {
            \fill[brown!70!black] (\x,6.5) rectangle +(.5,.5);
        }
        \foreach \x in {3.5,4}
        {
            \fill[yellow!50!orange] (\x,6.5) rectangle +(.5,.5);
        }
        \fill[black] (4.5,6.5) rectangle +(.5,.5);
        \fill[yellow!50!orange] (5,6.5) rectangle +(.5,.5);
            \fill[brown!70!black] (1.5,6) rectangle +(.5,.5);
            \fill[yellow!50!orange] (2,6) rectangle +(.5,.5);
            \fill[brown!70!black] (2.5,6) rectangle +(.5,.5);
            \fill[yellow!50!orange] (3,6) rectangle +(.5,.5);
            \fill[yellow!50!orange] (3.5,6) rectangle +(.5,.5);
            \fill[yellow!50!orange] (4,6) rectangle +(.5,.5);
                \fill[black] (4.5,6) rectangle +(.5,.5);
                \fill[yellow!50!orange] (5,6) rectangle +(.5,.5);
                \fill[yellow!50!orange] (5.5,6) rectangle +(.5,.5);
                \fill[yellow!50!orange] (6,6) rectangle +(.5,.5);
        \begin{scope}[shift={(0,-.5)}]
            \fill[brown!70!black] (1.5,6) rectangle +(.5,.5);
            \fill[yellow!50!orange] (2,6) rectangle +(.5,.5);
            \fill[brown!70!black] (2.5,6) rectangle +(.5,.5);
            \fill[brown!70!black] (3,6) rectangle +(.5,.5);
            \fill[yellow!50!orange] (3.5,6) rectangle +(.5,.5);
            \fill[yellow!50!orange] (4,6) rectangle +(.5,.5);
                \fill[yellow!50!orange] (4.5,6) rectangle +(.5,.5);
                \fill[black] (5,6) rectangle +(.5,.5);
                \fill[yellow!50!orange] (5.5,6) rectangle +(.5,.5);
                \fill[yellow!50!orange] (6,6) rectangle +(.5,.5);
                \fill[yellow!50!orange] (6.5,6) rectangle +(.5,.5);
        \end{scope}
        \fill[brown!70!black] (2,5) rectangle +(.5,.5);
        \foreach \x in {2.5,3,...,4}
        {
            \fill[yellow!50!orange] (\x,5) rectangle +(.5,.5);
        }
        \foreach \x in {4.5,5,...,6}
        {
            \fill[black] (\x,5) rectangle +(.5,.5);
        }
        \foreach \x in {2.5,3,...,5}
        {
            \fill[yellow!50!orange] (\x,4.5) rectangle +(.5,.5);
        }
        \foreach \x in {2,2.5,...,5.5}
        {
            \fill[red] (\x,4) rectangle +(.5,.5);
        }
        \fill[blue] (3,4) rectangle +(.5,.5);
        \fill[blue] (4.5,4) rectangle +(.5,.5);
        \begin{scope}[shift={(0,-.5)}]
            \foreach \x in {1.5,2,...,6}
            {
                \fill[red] (\x,4) rectangle +(.5,.5);
            }
            \fill[blue] (3,4) rectangle +(.5,.5);
            \fill[blue] (4.5,4) rectangle +(.5,.5);
        \end{scope}
        \begin{scope}[shift={(0,-1)}]
            \foreach \x in {1,1.5,2,...,6.5}
            {
                \fill[red] (\x,4) rectangle +(.5,.5);
            }
            \fill[blue] (3,4) rectangle +(.5,.5);
                \fill[blue] (3.5,4) rectangle +(.5,.5);
                \fill[blue] (4,4) rectangle +(.5,.5);
            \fill[blue] (4.5,4) rectangle +(.5,.5);
        \end{scope}
        \fill[yellow!50!orange] (1,2.5) rectangle +(.5,.5);
        \fill[yellow!50!orange] (1.5,2.5) rectangle +(.5,.5);
            \fill[red] (2,2.5) rectangle +(.5,.5);
            \fill[blue] (2.5,2.5) rectangle +(.5,.5);
                \fill[yellow!50!orange] (3,2.5) rectangle +(.5,.5);
            \fill[blue] (3.5,2.5) rectangle +(.5,.5);
            \fill[blue] (4,2.5) rectangle +(.5,.5);
                \fill[yellow!50!orange] (4.5,2.5) rectangle +(.5,.5);
            \fill[blue] (5,2.5) rectangle +(.5,.5);
            \fill[red] (5.5,2.5) rectangle +(.5,.5);
                \fill[yellow!50!orange] (6,2.5) rectangle +(.5,.5);
                \fill[yellow!50!orange] (6.5,2.5) rectangle +(.5,.5);
        \foreach \x in {1,1.5,2}
        {
            \fill[yellow!50!orange] (\x,2) rectangle +(.5,.5);
        }
        \foreach \x in {2.5,3,...,5}
        {
            \fill[blue] (\x,2) rectangle +(.5,.5);
        }
        \fill[yellow!50!orange] (5.5,2) rectangle +(.5,.5);
        \fill[yellow!50!orange] (6,2) rectangle +(.5,.5);
        \fill[yellow!50!orange] (6.5,2) rectangle +(.5,.5);
        \begin{scope}[shift={(0,-1)}]
            \fill[yellow!50!orange] (1,2.5) rectangle +(.5,.5);
            \fill[yellow!50!orange] (1.5,2.5) rectangle +(.5,.5);
                \fill[blue] (2,2.5) rectangle +(.5,.5);
                \fill[blue] (2.5,2.5) rectangle +(.5,.5);
                    \fill[blue] (3,2.5) rectangle +(.5,.5);
                \fill[blue] (3.5,2.5) rectangle +(.5,.5);
                \fill[blue] (4,2.5) rectangle +(.5,.5);
                    \fill[blue] (4.5,2.5) rectangle +(.5,.5);
                \fill[blue] (5,2.5) rectangle +(.5,.5);
                \fill[blue] (5.5,2.5) rectangle +(.5,.5);
                    \fill[yellow!50!orange] (6,2.5) rectangle +(.5,.5);
                    \fill[yellow!50!orange] (6.5,2.5) rectangle +(.5,.5);
        \end{scope}
            \foreach \x in {2,2.5,3}
            {
                \fill[blue] (\x,1) rectangle +(.5,.5);
            }
        \begin{scope}[shift={(2.5,0)}]
            \foreach \x in {2,2.5,3}
            {
                \fill[blue] (\x,1) rectangle +(.5,.5);
            }
        \end{scope}
        \foreach \x in {1.5,2,2.5}
        {
            \fill[brown!70!black] (\x,.5) rectangle +(.5,.5);
        }
        \begin{scope}[shift={(3.5,0)}]
            \foreach \x in {1.5,2,2.5}
            {
                \fill[brown!70!black] (\x,.5) rectangle +(.5,.5);
            }
        \end{scope}
        \begin{scope}[shift={(0,-.5)}]
            \foreach \x in {1,1.5,2,2.5}
            {
                \fill[brown!70!black] (\x,.5) rectangle +(.5,.5);
            }
            \begin{scope}[shift={(4,0)}]
                \foreach \x in {1,1.5,2,2.5}
                {
                    \fill[brown!70!black] (\x,.5) rectangle +(.5,.5);
                }
            \end{scope}
        \end{scope}
    \end{tikzpicture}
\end{document}

输出如下:

截屏

原文如下:

截屏

因为你可以在 Ti 中创建简单的动画和控件Z(参见 Rubiks 线程),也许可以生成一个世界(例如来自 Mario),通过一些按钮进行刷新。

对于初学者来说,我认为乒乓球游戏绝对足够了,因为实现这样的事情真的很难,特别是在 TiZ。

正如标题所说,这听起来伟大的如果这样的事情真的存在,那么我的问题是:有人知道怎么做吗?这不是一个“帮我做”的问题,而是收集想法。

答案1

滑动拼图

(需要 Acrobat Reader;pdflatexlualatex

这是一款具有用户交互的复杂游戏,基于 PDF 图层(OCG、包ocgx2)。

图片被分成 15 个图块,每个图块堆叠在一起,用于拼图板的每个单元,每个图块位于单独的 PDF 层上。因此,PDF 层的总数为 4 x 4 x 15 = 240。它们的可见性由 JavaScript 控制,通过单击拼图板顶部覆盖的透明按钮阵列来触发。

在此处输入图片描述

\documentclass[tikz,margin=1mm]{standalone}

\usepackage{xsavebox}
\usepackage[tikz]{ocgx2}
\usepackage{media9} % \mediabutton

\usepackage{tikzmarmots}
\usepackage{xcolor}\pagecolor{gray}
\usepackage{multido}
\usepackage{ifluatex}
\ifluatex\def\pdfpageattr{\pdfvariable pageattr}\fi

\begin{xlrbox}{Marmot}
  \begin{tikzpicture}[xscale=-1,transform shape]
    \useasboundingbox (0,0) rectangle (4.4,4.4);
    \node at (current bounding box.center) {\tikz\marmot[scale=2.1];};
  \end{tikzpicture}
\end{xlrbox}

%generating tiles Marmot.1, ..., Marmot.15
\multido{\nX=0.0+1.1,\iI=0+1}{4}{
  \multido{\nY=3.3+-1.1,\iJ=0+1}{4}{
    \ifnum\numexpr\iI+\iJ\relax>0
      \begin{xlrbox}{Marmot.\the\numexpr\iI+\iJ*4\relax}
        \begin{tikzpicture}
          \useasboundingbox (\nX,\nY) rectangle ++(1.1,1.1);
          \clip (\nX,\nY) rectangle ++(1.1,1.1);
          \node[inner sep=0pt, outer sep=0pt, anchor=south west,fill=white] at (0,0) {\theMarmot};
        \end{tikzpicture}
      \end{xlrbox}
    \fi
  }
}

\newcommand\MyStatus[2]{\ifnum#1=#2 visible\else invisible\fi}

%initialisations (JavaScript) on page-open (/O <<...>>)
\begingroup
\edef\x{\endgroup
  \pdfpageattr{
    \the\pdfpageattr
    /AA << /O << /S/JavaScript /JS (%
      var tile=new Array(4);
      var oldTile=new Array(4);
      for(var i=0;i<4;i++){
        tile[i]=new Array(4);
        oldTile[i]=new Array(4);
        for(var j=0;j<4;j++){
          tile[i][j]=new Array(15);
          oldTile[i][j]=i+j*4-1;
        }
      }
      ocg=this.getOCGs(this.pageNum);
      for(var i in ocg){
        ocgName=ocg[i].name.split('.');
        tile[ocgName[0]][ocgName[1]][ocgName[2]-1]=ocg[i];
      }%
      var swap_i=0; var swap_j=0;
      var onButtonClick=function(i,j){
        if(swap_i==i && swap_j!=j){
          for(var jj=swap_j; jj!=j; swap_j<j ? jj++ : jj--){
            if(jj!=swap_j) tile[i][jj][oldTile[i][jj]].state=false;
            newTile=oldTile[i][swap_j<j ? jj+1 : jj-1];
            oldTile[i][jj]=newTile;
            tile[i][jj][newTile].state=true;
          }
        } else if(swap_j==j && swap_i!=i){
          for(var ii=swap_i; ii!=i; swap_i<i ? ii++ : ii--){
            if(ii!=swap_i) tile[ii][j][oldTile[ii][j]].state=false;
            newTile=oldTile[swap_i<i ? ii+1 : ii-1][j];
            oldTile[ii][j]=newTile;
            tile[ii][j][newTile].state=true;
          }
        }
        if(swap_i==i || swap_j==j){
          if(oldTile[i][j]>-1)
            tile[i][j][oldTile[i][j]].state=false;
          oldTile[i][j]=-1;
          swap_i=i; swap_j=j;
        }
      };
    ) >> >>
  }
}
\x

\begin{document}

\begin{tikzpicture}
  \multido{\nX=0.0+1.1,\iI=0+1}{4}{%
    \multido{\nY=3.3+-1.1,\iJ=0+1}{4}{%
      %tiles
      \multido{\iK=1+1}{15}{%
        \begin{scope}[ocg={ref=\iI.\iJ.\iK,status=\MyStatus{\the\numexpr\iI+\iJ*4\relax}{\iK}}]%
          \node[inner sep=0pt, outer sep=0pt, anchor=south west] at (\nX,\nY) {\xusebox{Marmot.\iK}};
        \end{scope}
      }
      %button array
      \draw[
        line width=0,
        postaction={
          path picture={
            \path (path picture bounding box.south west) coordinate (p1)
              (path picture bounding box.north east) coordinate (p2)
              (p1) node[inner sep=0pt,anchor=south west,outer sep=0pt] {%
                \mediabutton[jsaction={try{onButtonClick(\iI,\iJ);}catch(e){}}]{%
                  \tikz \useasboundingbox (p1) rectangle (p2);%
                }%
              };
          }
        }
      ] (\nX,\nY) rectangle ++(1.1,1.1);
    }
  }
\end{tikzpicture}

\end{document}

原始答案

对于这种基于使用给定预定义颜色集的像素阵列的游戏,TikZ 部分很容易实现;利用包ocgx2,我们只是将每个像素颜色放在单独的 PDF 层上。

然后,整个游戏逻辑就可以用 JavaScript 实现。它以编程方式控制每个像素颜色的可见性。

作为一个简单的例子,我们实现了一个“游戏”,它的唯一目的是通过按下按钮来改变像素颜色并享受结果(爱看阅读器或者福讯观看所需):

在此处输入图片描述

\documentclass[tikz,margin=1mm]{standalone}
\usepackage[tikz]{ocgx2}
\usepackage{media9} % \mediabutton

\newcommand{\mycolour}[1]{\ifcase#1
white%0
\or
black%1
\or
red%2
\or
orange%3
\or
blue%4
\or
brown%5
\or
yellow%6
\fi}

\begin{document}

%set up canvas (16x16 pixels^2) x (7 colours)
\begin{tikzpicture}
  \foreach \X in {0,1,...,15} {
    \foreach \Y in {0,1,...,15} {
      \foreach \Z in {0,1,...,6} {
        \begin{scope}[ocg={ref=\X.\Y.\Z,status=invisible}]
          \node[minimum size=0.5cm,draw,fill=\mycolour{\Z}] at (\X/2,-\Y/2){};
        \end{scope}
      }
    }
  }
  \node at (3.75,-8) {%
    \mediabutton[
      jsaction={
        %initialisation
        if(typeof pixelcolour==='undefined'){
          var pixelcolour=new Array(16);
          var oldcolour=new Array(16);
          for(var i=0;i<16;i++){
            pixelcolour[i]=new Array(16);
            oldcolour[i]=new Array(16);
            for(var j=0;j<16;j++){
              pixelcolour[i][j]=new Array(7);
              oldcolour[i][j]=0;
            }
          }
          ocg=this.getOCGs(this.pageNum);
          for(i in ocg){
            ocgName=ocg[i].name.split('.');
            pixelcolour[ocgName[0]][ocgName[1]][ocgName[2]]=ocg[i];
          }  
        }
        %randomise colours
        for(i=0;i<16;i++){
          for(j=0;j<16;j++){
            newcolour=Math.floor(Math.random()*7);
            pixelcolour[i][j][oldcolour[i][j]].state=false;
            pixelcolour[i][j][newcolour].state=true;
            oldcolour[i][j]=newcolour;
          }
        }
      }
    ]{\fbox{Random}}
  };
\end{tikzpicture}
\end{document}

答案2

超级马里奥的四个步骤。

\documentclass{article}
\usepackage{tikz}
\usepackage{animate}

\newcommand{\MarioStop}{
\fill[red] (2.5,8) -- (5,8) -- (5,7.5) -- (6.5,7.5) -- (6.5,7) -- (2,7) -- (2,7.5) -- (2.5,7.5);
\fill[brown!70!black] (2,7) -- (3.5,7) -- (3.5,6.5) -- (3,6.5) -- (3,6) -- (3.5,6) -- (3.5,5.5) -- (2.5,5.5) -- (2.5,6.5) -- (2,6.5);
\fill[brown!70!black] (4.5,7) -- (4.5,6) -- (5,6) -- (5,7);
\fill[brown!70!black](5,6) -- (5.5,6) -- (5.5,5.5) -- (6.5,5.5) -- (6.5,5) -- (4.5,5) -- (4.5,5.5) -- (5,5.5);
\fill[brown!70!black] (1.5,6.5) -- (2,6.5) -- (2,5.5) -- (2.5,5.5) -- (2.5,5) -- (1.5,5);
\fill[yellow!50!orange] (3.5,7) -- (4.5,7) -- (4.5,6) -- (5,6) -- (5,5.5) -- (4.5,5.5) -- (4.5,5) -- (6,5) -- (6,4.5) -- (2.5,4.5) -- (2.5,5.5) -- (3.5,5.5) -- (3.5,6) -- (3,6) -- (3,6.5) -- (3.5,6.5);
\fill[yellow!50!orange] (2,6.5) -- (2.5,6.5) -- (2.5,5.5) -- (2,5.5);
\fill[yellow!50!orange] (5,7) -- (5.5,7) -- (5.5,6.5) -- (6.5,6.5) -- (6.5,6) -- (7,6) -- (7,5.5) -- (5.5,5.5) -- (5.5,6) -- (5,6);
\fill[red] (2,4.5) -- (3,4.5) -- (3,3) -- (2.5,3) -- (2.5,2.5) -- (2,2.5) -- (2,3) -- (1,3) -- (1,3.5) -- (1.5,3.5) -- (1.5,4) -- (2,4);
\fill[red] (3.5,4.5) -- (5.5,4.5) -- (5.5,4) -- (6.5,4) -- (6.5,3.5) -- (7,3.5) -- (7,3) -- (6,3) -- (6,2.5) -- (5.5,2.5) -- (5.5,3) -- (5,3) -- (5,4) -- (4.5,4) -- (4.5,3.5) -- (3.5,3.5);
\fill[blue] (3,4.5) -- (3.5,4.5) -- (3.5,3.5) -- (4.5,3.5) -- (4.5,4) -- (5,4) -- (5,3) -- (5.5,3) -- (5.5,2) -- (6,2) -- (6,1) -- (4.5,1) -- (4.5,1.5) -- (3.5,1.5) -- (3.5,1) -- (2,1) -- (2,2) -- (2.5,2) -- (2.5,3) -- (3,3);
\fill[yellow!50!orange] (3,3) -- (3.5,3) -- (3.5,2.5) -- (3,2.5);
\fill[yellow!50!orange] (4.5,3) -- (5,3) -- (5,2.5) -- (4.5,2.5);
\fill[yellow!50!orange] (6,3) -- (7,3) -- (7,1.5) -- (6,1.5) -- (6,2) -- (5.5,2) -- (5.5,2.5) -- (6,2.5);
\fill[yellow!50!orange] (1,3) -- (2,3) -- (2,2.5) -- (2.5,2.5) -- (2.5,2) -- (2,2) -- (2,1.5) -- (1,1.5);
\fill[brown!70!black] (1.5,1) -- (3,1) -- (3,0) -- (1,0) -- (1,0.5) -- (1.5,0.5);
\fill[brown!70!black] (5,1) -- (6.5,1) -- (6.5,0.5) -- (7,0.5) -- (7,0) -- (5,0);
}
\newcommand{\MarioFStep}{
\fill[red] (3,7.5) -- (5.5,7.5) -- (5.5,7) -- (7,7) -- (7,6.5) -- (2.5,6.5) -- (2.5,7) -- (3,7);
\fill[brown!70!black] (2.5,6.5) -- (4,6.5) -- (4,6) -- (3.5,6) -- (3.5,5.5) -- (4,5.5) -- (4,5) -- (3,5) -- (3,6) -- (2.5,6);
\fill[brown!70!black] (2,6) -- (2.5,6) -- (2.5,5) -- (3,5) -- (3,4.5) -- (2,4.5);
\fill[brown!70!black] (5,6.5) -- (5,5.5) -- (5.5,5.5) -- (5.5,6.5);
\fill[brown!70!black] (5.5,5.5) -- (6,5.5) -- (6,5) -- (7,5) -- (7,4.5) -- (5,4.5) -- (5,5) -- (5.5,5);
\fill[brown!70!black] (1.5,2.5) -- (2.5,2.5) -- (2.5,2) -- (2,2) -- (2,1) -- (1.5,1) -- (1.5,0.5) -- (1,0.5) -- (1,1.5) -- (1.5,1.5);
\fill[brown!70!black] (3.5,1) -- (5,1) -- (5,0.5) -- (5.5,0.5) -- (5.5,0) -- (3.5,0);
\fill[yellow!50!orange]  (2.5,6) -- (3,6) -- (3,5) -- (2.5,5);
\fill[yellow!50!orange] (4,6.5) -- (5,6.5) -- (5,5.5) -- (5.5,5.5) -- (5.5,5) -- (5,5) -- (5,4.5) -- (6.5,4.5) -- (6.5,3.5) -- (7,3.5) -- (7,3) -- (6.5,3) -- (6.5,2.5) -- (5.5,2.5) -- (5.5,3.5) -- (6,3.5) -- (6,4) -- (3,4) -- (3,5) -- (4,5) -- (4,5.5) -- (3.5,5.5) -- (3.5,6) -- (4,6);
\fill[yellow!50!orange]  (5.5,6.5) -- (6,6.5) -- (6,6) -- (7,6) -- (7,5.5) -- (7.5,5.5) -- (7.5,5) -- (6,5) -- (6,5.5) -- (5.5,5.5);
\fill[yellow!50!orange] (2,3.5) -- (2.5,3.5) -- (2.5,2.5) -- (1.5,2.5) -- (1.5,3) -- (2,3);
\fill[red] (2.5,4) -- (4.5,4) -- (4.5,3.5) -- (5,3.5) -- (5,4) -- (5.5,4) -- (5.5,2.5) -- (3,2.5) -- (3,3) -- (2.5,3);
\fill[blue] (4.5,4) -- (4.5,3.5) -- (5,3.5) -- (5,4);
\fill[blue] (2.5,3) -- (3,3) -- (3,2.5) -- (6,2.5) -- (6,1.5) -- (5.5,1.5) -- (5.5,1) -- (4,1) -- (4,1.5) -- (3.5,1.5) -- (3.5,1) -- (2,1) -- (2,2) -- (2.5,2);
}
\newcommand{\MarioSStep}{
\fill[red] (3,8) -- (5.5,8) -- (5.5,7.5) -- (7,7.5) -- (7,7) -- (2.5,7) -- (2.5,7.5) -- (3,7.5);
\fill[red] (1.5,4.5) -- (3.5,4.5) -- (3.5,3) -- (2.5,3) -- (2.5,3.5) -- (1.5,3.5);
\fill[red] (4.5,4.5) -- (5.5,4.5) -- (5.5,4) -- (6.5,4) -- (6.5,3.5) -- (7,3.5) -- (7,3) -- (6,3) -- (6,3.5) -- (5,3.5) -- (5,4) -- (4.5,4);
\fill[brown!70!black] (2.5,7) -- (4,7) -- (4,6.5) -- (3.5,6.5) -- (3.5,6) -- (4,6) -- (4,5.5) -- (3,5.5) -- (3,6.5) -- (2.5,6.5);
\fill[brown!70!black]  (2,6.5) -- (2.5,6.5) -- (2.5,5.5) -- (3,5.5) -- (3,5) -- (2,5);
\fill[brown!70!black]  (5,7) -- (5,6) -- (5.5,6) -- (5.5,7);
\fill[brown!70!black]  (5.5,6) -- (6,6) -- (6,5.5) -- (7,5.5) -- (7,5) -- (5,5) -- (5,5.5) -- (5.5,5.5);
\fill[brown!70!black]  (1,1.5) -- (2,1.5) -- (2,1) -- (2.5,1) -- (2.5,0.5) -- (3,0.5) -- (3,0) -- (1.5,0) -- (1.5,0.5) -- (1,0.5);
\fill[brown!70!black]  (6.5,2.5) -- (7,2.5) -- (7,3) -- (7.5,3) -- (7.5,1) -- (6.5,1);
\fill[yellow!50!orange] (4,7) -- (5,7) -- (5,6) -- (5.5,6) -- (5.5,5.5) -- (5,5.5) -- (5,5) -- (6.5,5) -- (6.5,4.5) -- (3,4.5) -- (3,5.5) -- (4,5.5) -- (4,6) -- (3.5,6) -- (3.5,6.5) -- (4,6.5);
\fill[yellow!50!orange] (2.5,6.5) -- (3,6.5) -- (3,5.5) -- (2.5,5.5);
\fill[yellow!50!orange] (5.5,7) -- (6,7) -- (6,6.5) -- (7,6.5) -- (7,6) -- (7.5,6) -- (7.5,5.5) -- (6,5.5) -- (6,6) -- (5.5,6);
\fill[yellow!50!orange] (0.5,4) -- (1.5,4) -- (1.5,3.5) -- (2,3.5) -- (2,3) -- (1.5,3) -- (1.5,2.5) -- (0.5,2.5);
\fill[yellow!50!orange] (6.5,4) -- (8,4) -- (8,3) -- (7,3) -- (7,3.5) -- (6.5,3.5);
\fill[blue] (3.5,4.5) -- (4.5,4.5) -- (4.5,4) -- (5,4) -- (5,3.5) -- (6,3.5) -- (6,2.5) -- (6.5,2.5) -- (6.5,1) -- (5,1) -- (5,1.5) -- (3.5,1.5) -- (3.5,1) -- (2,1) -- (2,1.5) -- (1.5,1.5) -- (1.5,2) -- (2,2) -- (2,2.5) -- (2.5,2.5) -- (2.5,3) -- (3.5,3);
\fill[yellow!50!orange] (4,3.5) -- (4.5,3.5) -- (4.5,3) -- (4,3);
}
\begin{document}

\begin{animateinline}[autoplay,loop,
    begin={\begin{tikzpicture}},
    end={\end{tikzpicture}}]{2}
\MarioStop\newframe
\MarioFStep\newframe
\MarioSStep\newframe
\MarioFStep\newframe
\MarioSStep\newframe
\MarioFStep\newframe
\MarioSStep\newframe
\MarioFStep\newframe
\MarioSStep\newframe
\MarioStop
\end{animateinline}
\end{document}

超级马里奥四步

相关内容