Chapter 10. Pokémon Battle

Now that we have a grasp of how we can create our own custom types, we will expand upon it in this chapter. In this chapter, we will go through the following things:

  • Creating a custom Pokémon type
  • Creating instances of our Pokémon type and having them interact with each other
  • Having Charizard and Pikachu fight with each other to solidify our understanding of having instances interact through the use of the methods that we create
  • Having our Pokémon hug it out to help us understand how instances interact with each other

Pokémon type

When creating a program, there are times when you will want the instances of your various types to interact, in ways that allow them to communicate with each other (as in the real world). What does ...

Get Swift iOS Programming for Kids now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.