On this page:
4.1 Villain Kata (difficulty = 1)
4.2 Villain Kata (difficulty = 3)
4.3 Villain Kata (difficulty = 5)
4.4 Villain Power Kata (difficulty = 2)
4.5 Villain Power Kata (difficulty = 4)

4 Villain Katas

4.1 Villain Kata (difficulty = 1)

read
Code a game with a villain.
code
#lang battlearena-avengers
 
(avengers-game
  #:villain-list (list (basic-villain)))

4.2 Villain Kata (difficulty = 3)

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

read
Code a game with several moderately intelligent Loki villains who have double health and shield.
code
#lang battlearena-avengers
 
(define (my-villain)
   (basic-villain
    #:sprite loki-sprite
    #:ai 'medium
    #:health 200
    #:shield 100
    #:amount-in-world 5))
 
(avengers-game
  #:villain-list (list (my-villain)))

4.3 Villain Kata (difficulty = 5)

Tip: Weak villains cannot take many hits. Strong villains can.

read
Code a game with 8 enemies: 5 weak with low intellegence, and 3 strong with high intelligence. Choose your own sprites.
code
#lang battlearena-avengers
 
(define (easy-villain)
   (basic-villain
    #:sprite wintersoldier-sprite
    #:ai 'easy
    #:health 50
    #:amount-in-world 5))
 
(define (hard-villain)
   (basic-villain
    #:sprite redskull-sprite
    #:ai 'hard
    #:health 200
    #:amount-in-world 3))
 
(avengers-game
  #:villain-list (list (easy-villain) (hard-villain)))

4.4 Villain Power Kata (difficulty = 2)

Tip: Here is a link to all available colors: colors.

read
Code a game with a villain that uses an energy blast of a custom color.
code
#lang battlearena-avengers
 
(avengers-game
  #:villain-list (list
   (basic-villain
    #:power (energy-blast #:color 'yellow))))

4.5 Villain Power Kata (difficulty = 4)

Tip: The default damage is 5 and the default speed is 10.

read
Code a game with Mandarin as the villain who uses a powerful, fast, custom-colored ring of fire that lasts a while.
code
#lang battlearena-avengers
 
(define (my-power)
   (ring-of-fire
    #:damage 50
    #:speed 10
    #:duration 20
    #:color 'purple))
 
(avengers-game
  #:villain-list (list
   (basic-villain
    #:sprite mandarin-sprite
    #:power (my-power))))