[Tex/LaTex] Catching Pokemon with TikZ … and why ducks matter

tikz-pgftikzduckstikzlibrary

A very creative professor once draw this picture while teaching about horizontal throw

enter image description here

which source is this video.

Once I saw it I tried to reproduce the draw as can be seen on my own, not very elegant, answer below.

My first attempt is indeed incredible ugly. I clearly don't have much skill with non-technical drawings.

Then I found out this interesting library of Pokemon's sprites as page numbering.

I really found very clever how each pokémon file was named as a number and this number is used at the respective page.

I used these sprites on my second attempt, which is much better than the first (horrible) attempt.

At this point I remembered the TikZ Ducks from TeX-Exchange and becoming a CTAN package.

The ducks TikZ package is incredible and has many options that makes me wonder: How could I do something similar with pokémons?
I mean, creating commands to insert pokémon, by name and/or by number and some options.

I tried \newcommand{\pikachu}{def}, with def as a TikZ code inside a \begin{scope} \end{scope}, however it just didn't work very well.

My third attempt using ducks got really nice. It catches the concept without relying on external figures.

And that's why ducks matter. I would like to know how to create simple commands to insert pokémon, actually, to insert any other tikz-define command or a predefined set of images.

I've seen a incredible work of art with TikZ by reproducing the surprised Pikachu in TikZ.
This is far better then the idea here but it is also complete out of my league.

As might be copyrights laws applied to official pokémon sprites, maybe something similar to what exists if someone searches for pokemon in Wolfram Alpha such as this Charizard could be used in TikZ.

I know about the tikzpgfmanual. Although it is a complete manual, it is not a simple task to directly learning some skills from it. I remember how much I improved when I learned about scope and only then I could dig into the manual knowing what I was looking for.

I'm not saying I will develop it of my own, but knowing the basics is a good start to develop the skills to do it or to contribute with it one day in the future.

Any ideas and suggestions are welcome.

Best Answer

This is the main .tex code I used

\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{ducks}
\begin{document}
    \input{fig_TikZ_parabola_Pikachu}
\end{document}

since I like to create tikzpictures on separated files. This is the fig_TikZ_parabola_Pikachu.tex file.

\begin{tikzpicture}
% --------------------
\draw (-1,0) -- (9,0);
\foreach \x in {-1,-0.5,...,9} {
    \begin{scope}[xshift=\x cm, green!50!black, very thick]
        \draw (0,0) -- ++(-0.15,-0.15);
    \end{scope}
};
\draw[dashed](0,0) -- ++(0,5);
\draw (0,0) -- ++(0,-1);
\draw[latex-latex] (0,-0.8) -- node[midway,above]{$x = ?$} ++(7.2,0);
\draw (7.2,0) -- ++(0,-1);
% --------------------

% --------------------
\draw[scale=1,domain=0:7,smooth,variable=\x,violet,dotted,very thick] plot ({\x},{-0.08*(\x)^2 + 5});
% --------------------

% --------------------
\begin{scope}[shift={(-1,5)}]
    \draw[fill=red] (0,0) -- ++(0.8,0) arc (180:0:0.2) -- ++(0.8,0) arc (-180:0:-1);
    \draw[fill=white] (0,0) -- ++(0.8,0) arc (-180:0:0.2) -- ++(0.8,0) arc (180:0:-1);
    \draw[fill=white] (1,0) circle (0.2);
    \draw[fill=black] (1,0) circle (0.1);
\end{scope}
% --------------------

% --------------------
% Pikachu Figure -- cute -- 3rd attempt
%\draw (6,0) pic [] {duck};
% --------------------

% --------------------
% Pikachu Figure -- cute -- 2nd attempt
\node at (7.5,1.5) {\includegraphics[width=3cm]{pikachu.png}};
% --------------------

% --------------------
% Pikachu in TikZ -- terrible -- 1st attempt
%\begin{scope}[shift={(5,0)}]
%   \draw[fill=yellow] (0.4,0) -- ++(2.9,0)
%   .. controls (3.5,0.7) and (3.5,0.9) .. 
%   (3.2,1.6) -- (5.2,3.3) coordinate(OD) -- (2.7,1.8)
%   .. controls (2,2.1) and (1.3,2.1) .. (0.7,1.8) --
%   (-1.3,3.3) coordinate(OE) -- (0.2,1.5)
%   .. controls (-0.1,0.8) and (-0.1,0.6) .. 
%   (0.1,0) -- cycle;
%   % --------------------
%   \draw[fill=red] (0.4,0.7) circle (0.2);
%   \draw[fill=red] (2.9,0.7) circle (0.2);
%   % --------------------
%   \draw[fill=black] (0.9,1.2) circle (0.2);
%   \draw[fill=black] (2.4,1.2) circle (0.2);
%   % --------------------
%   \draw[fill=white] (0.9,1.2) circle (0.05);
%   \draw[fill=white] (2.4,1.2) circle (0.05);
%   % --------------------
%   \draw[fill=black] (1,0.7) coordinate(B0) -- (2.3,0.7) coordinate(B1)
%   .. controls (1.9,0.2) and (1.3,0.2) .. cycle;
%   \draw[fill=white] (1,0.7) -- (2.3,0.7)
%   .. controls (1.9,0.5) and (1.3,0.5) ..
%   cycle;
%   % --------------------
%   \draw[fill=black] (OD) -- ++(-0.8,-0.7) -- +(-0.2,0.1) -- cycle;
%   % --------------------
%   \draw[fill=black] (OE) -- ++(0.6,-0.7) -- ++(0.2,0.1) -- cycle;
%   % --------------------
%\end{scope}
% --------------------

% --------------------
\node [rotate=90] at (-0.5,2) {$y = 45$ m};
\draw[blue, -latex] (0.5,3) -- node[midway, right]{$\vec{g} = 10 \dfrac{\mathrm{m}}{\mathrm{s}^2}$} ++(0,-2);
% --------------------
\draw[red, -latex] (1,5) -- node[midway, above]{$\vec{V}_0 = 5 \dfrac{\mathrm{m}}{\mathrm{s}}$} ++(2,0);
\draw[-latex] (5.7,3.9) node[above]{$t = 3$ s} -- ++(-0.6,-1);
% --------------------
\end{tikzpicture}

Each attempt is commented as a simple method to change between them.

The Pokéball is inspired at this draw.

The 1st attempt:

enter image description here

The 2nd attempt with external picture:

enter image description here

The 3rd attempt with ducks:

enter image description here

Related Question