On this page:
4.1 Sprites Kata (sprites-1)
4.2 Sprites Kata (sprites-2)
4.3 Sprites Kata (sprites-3)
4.4 Sprites Kata (sprites-4)
4.5 Sprites Kata (sprites-5)
4.6 Sprites Kata (sprites-6)

4 Sprites Katas

4.1 Sprites Kata (sprites-1)

Tip: For more options, in the interaction window type: pokemon, minecraft, marvel, starwars, harrypotter, mario, or all-sprites
read
Code a cutscene that has a sprite and text.
code
#lang cutscene
 
(story-cutscene
  (page pikachu-sprite "This is Pikachu."))

4.2 Sprites Kata (sprites-2)

read
Code a cutscene that has a background image, and a sprite and text moving across the screen.
code
#lang cutscene
 
(story-cutscene
  (page
   hulk-sprite
   "Hulk likes to walk"
   "inside volcanoes."
   #:bg lava-bg
   #:mode 'scroll-right))

4.3 Sprites Kata (sprites-3)

Tip: The default scroll speed is 50.
read
Code a cutscene that has a background image, and a sprite and text slowly moving to a corner.
code
#lang cutscene
 
(story-cutscene
  (page
   harrypotter-sprite
   "Harry walks slow in the snow."
   #:bg snow-bg
   #:mode 'scroll-top-right
   #:scroll-speed 30))

4.4 Sprites Kata (sprites-4)

Tip: For an entity the position (0,0) is the top-left corner.
read
Code a cutscene that has text and a sprite in a corner of the page.
code
#lang cutscene
 
(story-cutscene
  (page
   (make-entity
    yoda-sprite
    #:position (posn 20 20))
   "Yoda likes to be in a corner."))

4.5 Sprites Kata (sprites-5)

read
Code a cutscene that has text and 4 sprites. Each in a corner of the page.
code
#lang cutscene
 
(story-cutscene
  (page
   (make-entity
    mario-sprite
    #:position (posn 20 20))
   (make-entity
    luigi-sprite
    #:position (posn 780 20))
   (make-entity
    princesspeach-sprite
    #:position (posn 20 580))
   (make-entity
    toad-sprite
    #:position (posn 780 580))
   "Mario is playing 4 corners"
   "with his friends."))

4.6 Sprites Kata (sprites-6)

read
Code a cutscene that has a background image, customized text, and 2 sprites moving across the screen.
code
#lang cutscene
 
(story-cutscene
  (page
   (make-entity
    creeper-sprite
    #:position (posn 0 0)
    #:direction 45
    #:speed 100)
   (make-entity
    steve-sprite
    #:position (posn 40 40)
    #:direction 45
    #:speed 120)
   (make-entity
    "Steve, run!"
    #:color 'black
    #:underlined? #t
    #:font-size 20
    #:position (posn 400 500))
   #:bg desert-bg))