Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
arcade.draw_large_filled_circle(300, 500, arcade.color.YELLOW)
# Appear in third column
arcade.draw_standard_circle(500, 100,
arcade.color.YELLOW, "LARGE", "filled")
arcade.draw_standard_circle(500, 300,
arcade.color.YELLOW, "m", "filled")
arcade.draw_standard_circle(500, 500,
arcade.color.YELLOW, "small", "filled")
# Appear in fourth column
arcade.draw_circle_outline(700, 300, 50, arcade.color.YELLOW)
arcade.draw_circle(700, 100, 50, arcade.color.YELLOW)
arcade.open_window("Test Circles", 800, 600)
arcade.set_background_color(arcade.color.RED)
arcade.schedule(on_draw, 1/80)
arcade.run()
arcade.close_window()
def main():
# Create a window
arcade.open_window(1200, 600, "Lab 05 - Loopy Lab")
arcade.set_background_color(arcade.color.AIR_FORCE_BLUE)
arcade.start_render()
# Draw the outlines for the sections
draw_section_outlines()
# Draw the sections
draw_section_1()
draw_section_2()
draw_section_3()
draw_section_4()
draw_section_5()
draw_section_6()
draw_section_7()
draw_section_8()
"""
This is a sample program to show how to draw using functions
"""
import arcade
def draw_grass():
"""
This function draws the grass.
"""
arcade.draw_lrtb_rectangle_filled(0, 800, 200, 0, arcade.color.BITTER_LIME)
arcade.open_window(800, 600, "Drawing with Functions")
arcade.set_background_color(arcade.color.AIR_SUPERIORITY_BLUE)
arcade.start_render()
# Call our function to draw the grass
draw_grass()
arcade.finish_render()
arcade.run()
def main():
# Open up our window
arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, "Bouncing Rectangle Example")
arcade.set_background_color(arcade.color.WHITE)
# Tell the computer to call the draw command at the specified interval.
arcade.schedule(on_draw, 1 / 80)
# Run the program
arcade.run()
"""
Drawing an example happy face
If Python and Arcade are installed, this example can be run from the command line with:
python -m arcade.examples.happy_face
"""
import arcade
# Set constants for the screen size
SCREEN_WIDTH = 600
SCREEN_HEIGHT = 600
SCREEN_TITLE = "Happy Face Example"
# Open the window. Set the window title and dimensions
arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
# Set the background color
arcade.set_background_color(arcade.color.WHITE)
# Clear screen and start render process
arcade.start_render()
# --- Drawing Commands Will Go Here ---
# Draw the face
x = 300
y = 300
radius = 200
arcade.draw_circle_filled(x, y, radius, arcade.color.YELLOW)
# Draw the right eye
def main():
arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, "Drawing with Functions")
arcade.set_background_color(arcade.color.DARK_BLUE)
arcade.start_render()
draw_grass()
# Draw a snow person
# Snow
arcade.draw_circle_filled(300, 200, 60, arcade.color.WHITE)
arcade.draw_circle_filled(300, 280, 50, arcade.color.WHITE)
arcade.draw_circle_filled(300, 340, 40, arcade.color.WHITE)
# Eyes
arcade.draw_circle_filled(285, 350, 5, arcade.color.BLACK)
arcade.draw_circle_filled(315, 350, 5, arcade.color.BLACK)
def main():
"""
This is the main program.
"""
# Open the window
arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
# Start the render process. This must be done before any drawing commands.
arcade.start_render()
# Call our drawing functions.
draw_background()
# Loop to draw ten birds in random locations.
for bird_count in range(10):
# Any random x from 0 to the width of the screen
x = random.randrange(0, SCREEN_WIDTH)
# Any random y from in the top 2/3 of the screen.
# No birds on the ground.
y = random.randrange(SCREEN_HEIGHT / 3, SCREEN_HEIGHT - 20)
def main():
arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, "Drawing with Functions")
arcade.set_background_color(arcade.color.DARK_BLUE)
arcade.start_render()
draw_grass()
draw_snow_person(150, 140)
draw_snow_person(450, 180)
# Finish and run
arcade.finish_render()
arcade.run()
def main():
"""
This is the main function that we call to run our program.
"""
arcade.open_window(800, 600, "Drawing with Functions")
arcade.set_background_color(arcade.color.AIR_SUPERIORITY_BLUE)
arcade.start_render()
# Draw our pretty landscape
draw_grass()
draw_pine_tree(70, 90)
draw_pine_tree(150, 200)
draw_pine_tree(320, 180)
draw_pine_tree(520, 190)
draw_pine_tree(750, 80)
arcade.finish_render()
arcade.run()