knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
Play a role playing game in the R console.
# Install development version from GitHub devtools::install_github("anthonypileggi/rpg")
library(rpg) # Create a new player x <- Player$new("Hero") x # Fight some monsters x$fight("slime") x$fight("skeleton") # Check your current status x # Rest to heal yourself; if your HP falls to 0 then it's GAME OVER! x$rest() x # Watch out, it's a giant! x$fight("giant") # Whew, we did it. Now we just need to deal with one last slime... x$fight("slime")
Access your journal to relive the adventure!
cat(tail(x$journal))
Check out the full list of monsters you can fight!
bestiary()
I am also working on a shiny version. It is still WIP, but it already looks really neat thanks to the nessy
package!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.