animate_pacman: Create a Pac-Man Game GIF

View source: R/animate_pacman.R

animate_pacmanR Documentation

Create a Pac-Man Game GIF

Description

Create a Pac-Man Game GIF

Usage

animate_pacman(
  pacman,
  ghosts,
  file = NULL,
  caption = iconv("© Mickaël 'Coeos' Canouil", "UTF-8"),
  font_family = ""
)

Arguments

pacman

A data.frame with the coordinates of Pac-Man moves.

ghosts

A listof data.frame with the coordinates of (each) Ghost moves.

file

File name to save GIF on disk.

caption

A caption to add below the GIF.

font_family

The font family to use for the caption.

Value

Returns a gif_image object. See gganimate::gifski_renderer.

Examples


library(ggpacman)
if (interactive()) {
  animate_pacman(pacman = pacman, ghosts = list(blinky, pinky, inky, clyde))
}


mcanouil/ggpacman documentation built on Dec. 10, 2022, 12:29 p.m.