Use What We Learned
Try this yourself! Let me know what you came up with!
Do the same thing we did for the pokemon-service
, but with moves
, which are the attacks that Pokemon use in battle!
Here are the following files that you'll add to a moves
directory inside the data
directory.
I'd put my move-service
directory right next to the species-service
and call my file file.ts
again to communicate to future-you that this is the service that is reading from files.
Here is the data I'd put in the data/moves
directory. We'll add more detail later, but for now, let's just add this.
Don't forget to add an interface
in your types file!
// ./data/moves/1.json
{
"name": "Pound"
}
// ./data/moves/22.json
{
"name": "Vine Whip"
}
// ./data/moves/33.json
{
"name": "Tackle"
}
// ./data/moves/39.json
{
"name": "Tail Whip"
}
// ./data/moves/45.json
{
"name": "Growl"
}
// ./data/moves/52.json
{
"name": "Ember"
}
// ./data/moves/145.json
{
"name": "Bubble"
}
This will set us up for our next Main Quest which is generating Pokemon using Species Data! Don't miss it!
Last updated