-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from Nayan-Sinha/patch-1
Create Arcade Game
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
pip install arcade | ||
pip3 install arcade | ||
import arcade | ||
|
||
# Set constants for the screen size | ||
SCREEN_WIDTH = 600 | ||
SCREEN_HEIGHT = 600 | ||
|
||
# Open the window. Set the window title and dimensions (width and height) | ||
arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, "Drawing Example") | ||
|
||
# Set the background color to white. | ||
# For a list of named colors see: | ||
# http://arcade.academy/arcade.color.html | ||
# Colors can also be specified in (red, green, blue) format and | ||
# (red, green, blue, alpha) format. | ||
arcade.set_background_color(arcade.color.WHITE) | ||
|
||
# Start the render process. This must be done before any drawing commands. | ||
arcade.start_render() | ||
|
||
# Draw the face | ||
x = 300 | ||
y = 300 | ||
radius = 200 | ||
arcade.draw_circle_filled(x, y, radius, arcade.color.YELLOW) | ||
|
||
# Draw the right eye | ||
x = 370 | ||
y = 350 | ||
radius = 20 | ||
arcade.draw_circle_filled(x, y, radius, arcade.color.BLACK) | ||
|
||
# Draw the left eye | ||
x = 230 | ||
y = 350 | ||
radius = 20 | ||
arcade.draw_circle_filled(x, y, radius, arcade.color.BLACK) | ||
|
||
# Draw the smile | ||
x = 300 | ||
y = 280 | ||
width = 120 | ||
height = 100 | ||
start_angle = 190 | ||
end_angle = 350 | ||
arcade.draw_arc_outline(x, y, width, height, arcade.color.BLACK, start_angle, end_angle, 10) | ||
|
||
# Finish drawing and display the result | ||
arcade.finish_render() | ||
|
||
# Keep the window open until the user hits the 'close' button | ||
arcade.run() |