On this page:
5.1 Friend Kata (difficulty = 3)
5.2 Friend Kata (difficulty = 3)
5.3 Friend Kata (difficulty = 6)
5.4 Trainer Kata (difficulty = 4)
5.5 Trainer Kata (difficulty = 5)

5 Friend & Trainer Katas

5.1 Friend Kata (difficulty = 3)

read
Code a game with a Pokemon friend with custom dialog.
code
#lang survival-pokemon
 
(define (my-friend)
   (basic-friend
    #:dialog (list
     "Woah, who are you??"
     "Nevermind -- I'm too busy."
     "Move along, now!")))
 
(pokemon-game #:friend-list (list (my-friend)))

5.2 Friend Kata (difficulty = 3)

Tip: All options for #:mode are: ’follow, ’wander, ’pace and ’still.

read
Code a game with a Wartortle friend who follows you. Give them a name and a specific tile location.
code
#lang survival-pokemon
 
(define (my-friend)
   (basic-friend
    #:sprite wartortle-sprite
    #:name "Torts"
    #:tile 3
    #:mode 'follow))
 
(pokemon-game #:friend-list (list (my-friend)))

5.3 Friend Kata (difficulty = 6)

Tip: The customization options for npcs are: #:sprite, #:position, #:name, #:tile, #:mode, #:game-width, #:speed, #:target, #:sound, #:scale, and #:components.

read
Code a game with 2 friends with custom dialog and two additional customizations each.
code
#lang survival-pokemon
 
(define (my-friend)
   (basic-friend
    #:name "Francis"
    #:tile 4
    #:dialog (list
     "Greetings!"
     "You better find some food soon...")))
 
(define (another-friend)
   (basic-friend
    #:sprite ivysaur-sprite
    #:mode 'pace
    #:dialog (list
     "Now where did I put it..."
     "Have you seen a leaf stone?")))
 
(pokemon-game
  #:friend-list (list (my-friend) (another-friend)))

5.4 Trainer Kata (difficulty = 4)

Tip: The options for #:ai are ’easy, ’medium and ’hard.

read
Code a game with 5 highly intelligent Red Girl trainers armed with high-damage pokeballs.
code
#lang survival-pokemon
 
(define (hard-trainer)
   (basic-trainer
    #:ai 'hard
    #:sprite redgirl-sprite
    #:amount-in-world 5
    #:weapon (pokeball #:damage 50)))
 
(pokemon-game
  #:trainer-list (list (hard-trainer)))

5.5 Trainer Kata (difficulty = 5)

read
Code a game with 10 total trainers: half are moderately intelligent Green Boy trainers, and half are highly intelligent, nocturnal Team Rocket trainers.
code
#lang survival-pokemon
 
(define (easy-trainer)
   (basic-trainer
    #:ai 'medium
    #:sprite greenboy-sprite
    #:amount-in-world 5))
 
(define (hard-trainer)
   (basic-trainer
    #:ai 'hard
    #:sprite jessie-sprite
    #:amount-in-world 5
    #:night-only? #t))
 
(pokemon-game
  #:trainer-list (list (easy-trainer) (hard-trainer)))