Skip to content

Instantly share code, notes, and snippets.

@ashleygwilliams
Last active December 29, 2015 11:09
Show Gist options
  • Save ashleygwilliams/7661920 to your computer and use it in GitHub Desktop.
Save ashleygwilliams/7661920 to your computer and use it in GitHub Desktop.

#POKEMON CHALLENGE 1: Data Persistence, pt1

Scraping Bulbapedia everytime we want to make pokemon is probably not a good idea. It's a better idea to scrape just once, and store that data somewhere.

A way we can store that data is a type of data format called YAML. YAML stands for YAML ain't markup language, which isn't super important to know or understand right now.

What's important to know is that we can store our data in a way that looks a little bit like a nested, bulleted, list.

A good example of what this might look like is our student site: https://github.com/ashleygwilliams/webdev_fellowhome/blob/master/data/students.yml

Your challenge, should you choose to accept it, is to store all the information you are scraping from Bulbapedia into a YAML file that your app can now use to make pokemon.

Here are some resources and tutorials to get you started:

#POKEMON CHALLENGE 2: Data Persistence, pt2

Every time our users play our game, they have to create a new user, with a new team. This isn't very fun!

Create a new YAML file to store users. This should keep track of the user names, the user team, and the teams stats (i.e. exp, level, learnset.) The user should have to actively save, so build in a commadn to your app that the user can call on the command ine to electively save the game. To make sure data is not lost, prompt the user to save the game whenever they choose to exit.

When your start up your game, prompt the user if they want to load up a saved user.

Your YAML file should only support saving one user, so if the player chooses not to load up a saved user and creates a new one... your YAML file will be rewritten.

#POKEMON PRODUCT SPEC

Trainer

  • custom name, or default name randomly assigned from Ash, Misty, or Brock
  • a team of 5 randomly chosen pokemon
    • user can keep refreshing team til they choose a team they like, but after choice, team does not change
  • ability to change the order of the pokemon in the team

Pokemon

  • name, exp pts, level
  • has a learnset that contains moves and the level that pokemon gains that move
  • can gain exp
  • will grow a level when it reaches appropriate amount of exp
  • will gain moves when it is at the appropriate level
  • the ability to attack, when passed an attack name

Game

  • prompts user to make a trainer
  • prompts user to choose team
  • can call battle with a pokemon that has that pokemon gain exp
  • can exit game
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment