Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Python Tutorial
  • Interview Questions
  • Python Quiz
  • Python Glossary
  • Python Projects
  • Practice Python
  • Data Science With Python
  • Python Web Dev
  • DSA with Python
  • Python OOPs
Open In App
Next Article:
Python Arcade - Display Text
Next article icon

Arcade Library in Python

Last Updated : 02 Nov, 2020
Comments
Improve
Suggest changes
Like Article
Like
Report

For many years, Python game programmers were limited to the Pygame Module. But, now we have other choices as well i.e Arcade Python Library. The Arcade library is a modern Python Module used widely for developing 2D video games with compelling graphics and sound. Arcade is an object-oriented library. It can be installed like any other Python Package. It was written by Paul Vincent Craven, a computer science professor at Simpson College in Iowa, USA. 

Installation

To install this module, just simply run the following command on your command prompt:

pip install arcade       

Implementation

The following steps illustrate how to create a basic drawing using an arcade module:

  • Import module.
  • Specify the parameters for your output screen like width, height, etc.
  • Open the window using the inbuilt open_window() in the arcade. This command opens a window with a given size i.e width and height along with the screen title.

Syntax-

arcade.open_window(Width, Height, Title)

  • Set a background color (optional). It can be done using set_background_color() method built into arcade

Syntax-

arcade.set_background_color(arcade.color.color_name)

  • Tell your module to start drawing using start_render() command which is again built into arcade.

Syntax-

arcade.start_render()

  • Start designing, you can use functions already available with arcade to do so.
  • Tell arcade module that you have completed the drawing using finish_render().

Syntax-

arcade.finish_render()

  • Run your code using run().

Syntax-

arcade.run()

Example 1: Python program that uses arcade to draw a circle.

Python3




# Import module
import arcade
 
# Specify Parameters
Width = 500
Height = 700
Title = "Welcome to Arcade"
Radius = 100
 
# Open the window
arcade.open_window(Width, Height, Title)
 
# Set the background color
arcade.set_background_color(arcade.color.BLUE)
 
# start drawing
arcade.start_render()
 
# Draw a Pink circle
arcade.draw_circle_filled(
    Width/2 , Height/2 , Radius , arcade.color.PINK
)
# Finish drawing
arcade.finish_render()
 
# Display everything
arcade.run()
 
 

 
 

Output:

 

 

Example 2: Python program that creates a pattern of circles using the arcade

 

Python3




# Import module
import arcade
 
#Specify Parameters
Width = 500
Height = 700
Title = "Welcome to Arcade"
Radius = 200
 
# Open the window
arcade.open_window(Width, Height, Title)
 
# Set the background color
arcade.set_background_color(arcade.color.BLACK)
 
# start drawing
arcade.start_render()
 
# Draw a BLUE circle
arcade.draw_circle_filled(
    Width/2 , Height/2 , Radius , arcade.color.BLUE
)
 
# Draw a Red circle
arcade.draw_circle_filled(
    Width/2 , Height , Radius , arcade.color.RED
)
 
# Finish drawing
arcade.finish_render()
# Display everything
arcade.run()
 
 

 
 

Output:

 

Arcade is a set of python modules which is a modern Python framework used in designing 2D video games. In Arcade, we have gripping computer graphics and sound libraries in order to design high quality and user-friendly games. Arcade was developed by Paul Vincent Craven. Arcade needs support for OpenGL 3.3+.

Interesting facts about Arcade Library:

  • Arcade is built on top of Pyglet and OpenGL.
  • In order to replace Pygame, Arcade came into existence.
  • Arcade runs on Windows, Mac OS X, and Linux.
  • Arcade requires Python 3.6 or newer. It does not run on Python 2.x.
  • Arcade needs support for OpenGL 3.3+. It does not run on Raspberry Pi or Wayland. If on Linux, sound support needs at least GLIB 2.29+.
  • Arcade uses SoLoud. which Supports panning and volume.
  • It is possible to create open-source free, shareware, and commercial games with it.
  • Supports Python 3 type hinting.
  • Basic drawing does not require knowledge on how to define functions or classes or how to do loops.
  • Uses a standard coordinate system you learned about in math. (0, 0) is in the lower left, and not upper left. Y-coordinates are not reversed.
  • API documentation for the commands is better.

Active road-map of Arcade version 2 development :

  1. Version 2.4.3 was released 2020-09-30. It is the latest version of arcade that has Added PyInstalled hook and tutorial, ShapeLists have no longer share position between instances and with GUI improvement.
  2. Version 2.4.2 was released 2020-09-08. It has GPU transformations with the mouse and Updates downloadable .zip for platformer example code to match current code in documentation and much more.
  3.  Arcade 2.4.1 was released 2020-07-13. Support for defining your own frame buffers, shaders, and more advanced OpenGL programming, PyMunk engine for a platform, etc.


Next Article
Python Arcade - Display Text

A

anshitaagarwal
Improve
Article Tags :
  • Python
  • Python-Arcade
  • python-modules
Practice Tags :
  • python

Similar Reads

  • Draw a tree using arcade library in Python
    Drawing a tree isn't a tough task in Python using the turtle module. But, what if you can draw it using Arcade Module as well. Arcade is an object-oriented library. It can be installed like any other Python Package using an import arcade. Approach: Import arcade.Define a function to draw trees. Here
    3 min read
  • Python Arcade - Player Movement
    In this article, we will discuss How to move the players using arcade in Python. Automatic Movements We can easily move our players in any particular direction in the arcade. For this, we are going to draw a rectangle using the draw_rectangle_filled() method then we will change the x coordinate of t
    3 min read
  • Python Arcade - Display Text
    In this article, we will learn How we can add text to arcade games in Python. Adding Simple Text We can add text in the arcade using the draw_text() function. Syntax: arcade.draw_text(text, x, y, color, size, width, align, font_name) Parameters: text: Text we want to displayx : x coordinatey : y coo
    3 min read
  • Python Arcade - Display Score
    In this article, we will learn how to display scores in Arcade in Python. Displaying the Score In this example, we are going to simply display our score on the screen and we will increase the score every player jumps. For this, we will use some functions: draw_text(): This function is used to draw t
    7 min read
  • Draw a sun using arcade library Python
    You might have drawn Sun using famous Python module like turtle but here we discuss how the same approach can be achieved using arcade module. The Arcade library is a modern Python Module used widely for developing 2D video games with compelling graphics and sound. Arcade is an object-oriented libra
    2 min read
  • Python Arcade - Handling Keyboard Input
    In this article, we will discuss how to handle keyboard inputs in Python arcade module. In Arcade, you can easily check which keyboard button is pressed and perform tasks according to that.  For this, we are going to use these functions: on_key_press()on_key_release() Syntax: on_key_press(symbol,mod
    4 min read
  • Draw an ellipse using Arcade library in Python
    Prerequisite: Arcade Library The Arcade library is a modern Python Module used for developing 2D video games with enthralling graphics and sound. It is an object-oriented library. It can be installed like any other Python Package in your IDE. Arcade Module has two inbuilt functions for drawing an el
    3 min read
  • Python Arcade - Playing Audio file
    In this article, we will learn how to play or add audio in our Arcade games using Python. Playing Audio File In this example, we want to play our audio whenever the player touches the left or right end of the screen. For this, we are going to use 2 functions of the arcade module. arcade.load_sound()
    2 min read
  • Draw a happy face using Arcade Library in Python
    Arcade is a Python module used for developing 2D games. For drawing a happy face, steps are as follows: Import arcade library.import arcade Open the window.arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE) The function used with arcade is open_window. This command opens a window with a g
    3 min read
  • NumPy Array in Python
    NumPy (Numerical Python) is a powerful library for numerical computations in Python. It is commonly referred to multidimensional container that holds the same data type. It is the core data structure of the NumPy library and is optimized for numerical and scientific computation in Python. Table of C
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences