Guest User

Untitled

a guest
Jul 18th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. """
  2. This is a sample program to show how to draw using functions
  3. """
  4.  
  5. import arcade
  6.  
  7. def draw_grass():
  8. """
  9. This function draws the grass.
  10. """
  11. arcade.draw_lrtb_rectangle_filled(0, 800, 200, 0, arcade.color.BITTER_LIME)
  12.  
  13.  
  14. def draw_pine_tree():
  15. """
  16. This function draws a pine tree.
  17. """
  18.  
  19. # Draw the trunk
  20. arcade.draw_rectangle_filled(100, 200, 30, 80, arcade.color.BROWN)
  21.  
  22. # Draw three levels of triangles
  23. arcade.draw_triangle_filled(50, 215, 150, 215, 100, 320, arcade.color.FOREST_GREEN)
  24. arcade.draw_triangle_filled(50, 255, 150, 255, 100, 360, arcade.color.FOREST_GREEN)
  25. arcade.draw_triangle_filled(60, 295, 140, 295, 100, 400, arcade.color.FOREST_GREEN)
  26.  
  27. arcade.open_window(800, 600, "Drawing with Functions")
  28. arcade.set_background_color(arcade.color.AIR_SUPERIORITY_BLUE)
  29. arcade.start_render()
  30.  
  31. # Draw our pretty landscape
  32. draw_grass()
  33. draw_pine_tree()
  34.  
  35. arcade.finish_render()
  36. arcade.run()
Add Comment
Please, Sign In to add comment