Common Computer Science References
At the end of this lesson, you will be able to:
add random background
add a large image to a scene
scenes
review nested loops
create a matrix of random numbers
can you replace the numbers with a random image from a sprite bank?
code to add a large image to a scene
split image up into several parts
code for MT logo:
# used this program to split the image into tile:
# https://ezgif.com/sprite-cutter/ezgif-5-818cdbcc3f66.png
background.tile(2, 2, 0) # blank white
background.tile(3, 2, 1)
background.tile(4, 2, 2)
background.tile(5, 2, 3)
background.tile(6, 2, 4)
background.tile(7, 2, 0) # blank white
background.tile(2, 3, 0) # blank white
background.tile(3, 3, 5)
background.tile(4, 3, 6)
background.tile(5, 3, 7)
background.tile(6, 3, 8)
background.tile(7, 3, 0) # blank white
background.tile(2, 4, 0) # blank white
background.tile(3, 4, 9)
background.tile(4, 4, 10)
background.tile(5, 4, 11)
background.tile(6, 4, 12)
background.tile(7, 4, 0) # blank white
background.tile(2, 5, 0) # blank white
background.tile(3, 5, 0)
background.tile(4, 5, 13)
background.tile(5, 5, 14)
background.tile(6, 5, 0)
background.tile(7, 5, 0) # blank white
show demo of random background
create a random background for the game scene in the "Space Alien" game
have the following scenes in this order
splash_scene, with the coin sound, plain white background
menu_scene, this MT Game Studio logo and START button
game_scene
splash_scene
random background
This is "Blinka" the CircuitPython mascot.