diff --git a/en/step_2.md b/en/step_2.md index d9f5798a5..f25bbcaaa 100644 --- a/en/step_2.md +++ b/en/step_2.md @@ -34,7 +34,7 @@ line_number_start: 7 line_highlights: 8 --- -#Setup global variables +# Setup global variables screen_size = 400 --- /code --- @@ -55,7 +55,7 @@ line_highlights: 20 --- def setup(): - #Setup your animation here + # Setup your animation here size(screen_size, screen_size) @@ -93,11 +93,11 @@ line_highlights: 21-23 --- def setup(): - #Setup your animation here + # Setup your animation here size(screen_size, screen_size) - image_mode(CENTER) # Positions the image in the center + image_mode(CENTER) # Positions the image in the center global planet - planet = load_image('planet.png') # Your chosen planet + planet = load_image('planet.png') # Your chosen planet --- /code --- @@ -125,10 +125,10 @@ line_number_start: 14 line_highlights: 15-17 --- -#The draw_background function goes here +# The draw_background function goes here def draw_background(): - background(0) #Short for background(0, 0, 0) — black - image(planet, width/2, height, 300, 300) #Draw the image + background(0) # Short for background(0, 0, 0) — black + image(planet, width/2, height, 300, 300) # Draw the image --- /code --- @@ -151,7 +151,7 @@ line_highlights: 30 --- def draw(): - #Things to do in every frame + # Things to do in every frame draw_background() --- /code --- diff --git a/en/step_3.md b/en/step_3.md index f8c7a325f..83a4cbe05 100644 --- a/en/step_3.md +++ b/en/step_3.md @@ -33,7 +33,7 @@ line_highlights: 24, 26 --- def setup(): - #Setup your animation here + # Setup your animation here size(screen_size, screen_size) image_mode(CENTER) global planet, rocket @@ -61,9 +61,9 @@ line_number_start: 7 line_highlights: 9 --- -#Setup global variables +# Setup global variables screen_size = 400 -rocket_y = screen_size #Start at the bottom +rocket_y = screen_size # Start at the bottom --- /code --- @@ -84,10 +84,10 @@ line_number_start: 11 line_highlights: 12-16 --- -#The draw_rocket function goes here +# The draw_rocket function goes here def draw_rocket(): - global rocket_y #Use the global rocket_y variable - rocket_y -= 1 #Move the rocket + global rocket_y # Use the global rocket_y variable + rocket_y -= 1 # Move the rocket image(rocket, width/2, rocket_y, 64, 64) @@ -109,7 +109,7 @@ line_highlights: 36 --- def draw(): - #Things to do in every frame + # Things to do in every frame draw_background() draw_rocket() diff --git a/en/step_4.md b/en/step_4.md index 914e301af..eaa19a2d5 100644 --- a/en/step_4.md +++ b/en/step_4.md @@ -41,9 +41,9 @@ def draw_rocket(): no_stroke() #Turn off the stroke - for i in range(25): #Draw 25 burning exhaust ellipses - fill(255, 255, 0) #Yellow - ellipse(width/2, rocket_y + i, 8, 3) #i increases each time the loop repeats + for i in range(25): # Draw 25 burning exhaust ellipses + fill(255, 255, 0) # Yellow + ellipse(width/2, rocket_y + i, 8, 3) # i increases each time the loop repeats image(rocket, width/2, rocket_y, 64, 64) @@ -84,7 +84,7 @@ line_highlights: 19 --- for i in range(25): - fill(255, 255 - i * 10, 0) #Reduce the amount of green + fill(255, 255 - i * 10, 0) # Reduce the amount of green ellipse(width/2, rocket_y + i, 8, 3) --- /code --- @@ -122,8 +122,8 @@ line_highlights: 22-24 fill(255, 255 - i * 10, 0) ellipse(width/2, rocket_y + i, 8, 3) - fill(200, 200, 200, 100) #Transparent grey - for i in range(20): #Draw 20 random smoke ellipses + fill(200, 200, 200, 100) # Transparent grey + for i in range(20): # Draw 20 random smoke ellipses ellipse(width/2 + randint(-5, 5), rocket_y + randint(20, 50), randint(5, 10), randint(5, 10)) image(rocket, width/2, rocket_y, 64, 64) diff --git a/en/step_5.md b/en/step_5.md index 34003176b..73d83ed97 100644 --- a/en/step_5.md +++ b/en/step_5.md @@ -27,10 +27,10 @@ line_number_start: 7 line_highlights: 10 --- -#Setup global variables +# Setup global variables screen_size = 400 rocket_y = screen_size -burn = 100 #How much fuel is burned in each frame +burn = 100 # How much fuel is burned in each frame --- /code --- @@ -78,7 +78,7 @@ line_highlights: 15, 17-18 global rocket_y, fuel, burn rocket_y -= 1 - fuel -= burn #Burn fuel + fuel -= burn # Burn fuel print('Fuel left: ', fuel) --- /code --- @@ -114,12 +114,12 @@ line_highlights: 17-30 global rocket_y, fuel, burn - if fuel >= burn: #Still got fuel + if fuel >= burn: # Still got fuel rocket_y -= 1 fuel -= burn print('Fuel left: ', fuel) - no_stroke() #Turn off the stroke + no_stroke() # Turn off the stroke for i in range(25): fill(255, 255 - i*10, 0) diff --git a/en/step_6.md b/en/step_6.md index 753c6cdf1..dbc8f257d 100644 --- a/en/step_6.md +++ b/en/step_6.md @@ -32,7 +32,7 @@ line_number_start: 7 line_highlights: 11-12 --- -#Setup global variables +# Setup global variables screen_size = 400 rocket_y = screen_size burn = 100 @@ -57,11 +57,11 @@ line_highlights: 42-45 --- def draw_background(): - background(0) #Short for background(0, 0, 0) — black + background(0) # Short for background(0, 0, 0) — black image(planet, width/2, height, 300, 300) - no_fill() #Turn off any fill - stroke(255) #Set a white stroke + no_fill() # Turn off any fill + stroke(255) # Set a white stroke stroke_weight(2) ellipse(width/2, height, orbit_radius * 2, orbit_radius * 2) @@ -96,12 +96,12 @@ line_number_start: 15 line_highlights: 19 --- -#The draw_rocket function goes here +# The draw_rocket function goes here def draw_rocket(): global rocket_y, fuel, burn - if fuel >= burn and rocket_y > orbit_y: #Still flying + if fuel >= burn and rocket_y > orbit_y: # Still flying --- /code --- @@ -132,8 +132,8 @@ line_highlights: 34-35 for i in range(20): ellipse(width/2 + randint(-5, 5), rocket_y + randint(20, 50), randint(5, 10), randint(5, 10)) - if fuel < burn and rocket_y > orbit_y: #No more fuel and not in orbit - tint(255, 0, 0) #Failure + if fuel < burn and rocket_y > orbit_y: # No more fuel and not in orbit + tint(255, 0, 0) # Failure --- /code --- @@ -165,10 +165,10 @@ line_highlights: 38 --- if fuel < burn and rocket_y > orbit_y: - tint(255, 0, 0) #Failure + tint(255, 0, 0) # Failure image(rocket, width/2, rocket_y, 64, 64) -no_tint() #So the planet isn't tinted red in the next frame! +no_tint() # So the planet isn't tinted red in the next frame! --- /code --- @@ -189,9 +189,9 @@ line_highlights: 36-37 --- if fuel < burn and rocket_y > orbit_y: - tint(255, 0, 0) #Failure + tint(255, 0, 0) # Failure elif rocket_y <= orbit_y: - tint(0, 255, 0) #Success + tint(0, 255, 0) # Success image(rocket, width/2, rocket_y, 64, 64) no_tint() @@ -226,11 +226,11 @@ line_highlights: 36, 38-39 --- if fuel < burn and rocket_y > orbit_y: - tint(255, 0, 0) #Failure + tint(255, 0, 0) # Failure elif fuel < 1000 and rocket_y <= orbit_y: - tint(0, 255, 0) #Success + tint(0, 255, 0) # Success elif fuel >= 1000 and rocket_y <= orbit_y: - tint(255, 200, 0) #Too much fuel + tint(255, 200, 0) # Too much fuel image(rocket, width/2, rocket_y, 64, 64) no_tint() #So the planet isn't tinted in the next frame!