Skip to content

Commit ad75c29

Browse files
committed
Basic arcade program
1 parent 20d9242 commit ad75c29

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

arcade-a-primer/arcade_basic.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Basic arcade program
2+
# Displays a white window with a blue circle in the middle
3+
4+
# Imports
5+
import arcade
6+
7+
# Constants
8+
SCREEN_WIDTH = 600
9+
SCREEN_HEIGHT = 800
10+
SCREEN_TITLE = "Welcome to Arcade"
11+
RADIUS = 150
12+
13+
# Open the window
14+
arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
15+
16+
# Set the background color
17+
arcade.set_background_color(arcade.color.WHITE)
18+
19+
# Clear the screen and start drawing
20+
arcade.start_render()
21+
22+
# Draw a blue circle
23+
arcade.draw_circle_filled(
24+
SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, RADIUS, arcade.color.BLUE
25+
)
26+
27+
# Finish drawing
28+
arcade.finish_render()
29+
30+
# Display everything
31+
arcade.run()

0 commit comments

Comments
 (0)