-
Notifications
You must be signed in to change notification settings - Fork 790
Expand file tree
/
Copy pathlab_03.py
More file actions
46 lines (33 loc) · 1.22 KB
/
lab_03.py
File metadata and controls
46 lines (33 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import arcade
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
def draw_grass():
# Ground
arcade.draw_lrtb_rectangle_filled(0, SCREEN_WIDTH, SCREEN_HEIGHT / 3,0, arcade.color.AIR_SUPERIORITY_BLUE)
def draw_snow_person(x, y):
arcade.draw_point(x, y, arcade.color.RED,5)
# Snow
arcade.draw_circle_filled(x, 60 + y, 60, arcade.color.WHITE)
arcade.draw_circle_filled(x, 140 + y, 50, arcade.color.WHITE)
arcade.draw_circle_filled(x, 200 + y, 40, arcade.color.WHITE)
# Eyes
arcade.draw_circle_filled(x - 15, 210 + y, 5, arcade.color.BLACK)
arcade.draw_circle_filled(x + 15, 210 + y, 5, arcade.color.BLACK)
def on_draw(delta_time):
arcade.start_render()
draw_grass()
draw_snow_person(on_draw.snow_person1_x, 140)
draw_snow_person(on_draw.snow_person2_x, 140)
draw_snow_person(on_draw.snow_person3_x, y=140)
on_draw.snow_person1_x += 1
on_draw.snow_person2_x += 1
on_draw.snow_person3_x += 1
on_draw.snow_person1_x = 150
on_draw.snow_person2_x = 350
on_draw.snow_person3_x = 500
def main():
arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, "Drawing with Functions")
arcade.set_background_color(arcade.color.DARK_BLUE)
arcade.schedule(on_draw, 1 / 60)
arcade.run()
main()