Book
Module 7 - Section 0 - Snow fall and snowmen again
Module 7 - Section 0 - Snow fall and snowmen again
Completion requirements
View
7.0.3 - Animate shapes using and updating a list
To create multiple instances of a shape, or item, we can use a list to store the characteristics of the items. We used this technique to create snow flakes and then update the position of coordinate Y to look like a snowfall. Also after dissapearing from the screen the snowflake's position updated in a new position above the screen and start to fall again.
import random
snow_list = []
for i in range(50):
x = random.randrange(10,690)
y = random.randrange(10,490)
snow_list.append([x,y])
print(snow_list)