r/pythonarcade • u/Diapolo10 • Mar 29 '22
[Arcade] Checking for sprite intersections with lines
r/pythonarcade • u/Diapolo10 • Mar 29 '22
r/pythonarcade • u/bluespiritcz • Mar 29 '22
Hi, I have been recently experiencing graphical issues with rendering text in arcade (draw_text method). It does not happen right from the start but after few in-game restarts it randomly starts doing this (as you can see the text is glitching out like crazy).


It seems that the problem might be my new laptop with AMD Radeon because on my old PC with NVIDIA it never happens. I have tested with the newest arcade and python versions.
Just checking if anyone have already solved this. Thanks in advance for any ideas
r/pythonarcade • u/pvc • Mar 26 '22
Arcade version 2.6.13 has been released.
https://api.arcade.academy/en/latest/development/release_notes.html
Special thanks to Mohammad Ibrahim, pushfoo, Alejandro Casanovas, Maic Siemering, Cleptomania, pvcraven and einarf for their contributions to this release. Also, thanks to everyone on the Pyglet team! We depend heavily on Pyglet’s continued development.
r/pythonarcade • u/Rjagger • Mar 25 '22
Hi! Recently i switched from pygame to arcade after failing to make a CRT effect with ModernGL (or atleast thats how i found it). I have a feeling that the issue im having is stemming from me being on Manjaro Linux however i followed the arcade tutorial to learn the basic commands and i got an error, i tried direct copy and pasting, another error. After that i just tried to do a print and alas i was met with this.
I've tried importing the packages that it lists but i haven't had any success with that, any help is appreciated!

Traceback (most recent call last):
File "/home/rj/PycharmProjects/Pytcraft/main.py", line 1, in <module>
import arcade
File "/home/rj/PycharmProjects/Pytcraft/venv/lib/python3.10/site-packages/arcade/__init__.py", line 263, in <module>
from .sound import Sound
File "/home/rj/PycharmProjects/Pytcraft/venv/lib/python3.10/site-packages/arcade/sound.py", line 18, in <module>
import pyglet.media as media
File "/home/rj/PycharmProjects/Pytcraft/venv/lib/python3.10/site-packages/pyglet/media/__init__.py", line 145, in <module>
add_default_media_codecs()
File "/home/rj/PycharmProjects/Pytcraft/venv/lib/python3.10/site-packages/pyglet/media/codecs/__init__.py", line 102, in add_default_media_codecs
if have_ffmpeg():
File "/home/rj/PycharmProjects/Pytcraft/venv/lib/python3.10/site-packages/pyglet/media/codecs/__init__.py", line 124, in have_ffmpeg
from . import ffmpeg_lib
File "/home/rj/PycharmProjects/Pytcraft/venv/lib/python3.10/site-packages/pyglet/media/codecs/ffmpeg_lib/__init__.py", line 36, in <module>
from .libavcodec import *
File "/home/rj/PycharmProjects/Pytcraft/venv/lib/python3.10/site-packages/pyglet/media/codecs/ffmpeg_lib/libavcodec.py", line 46, in <module>
from . import libavutil
File "/home/rj/PycharmProjects/Pytcraft/venv/lib/python3.10/site-packages/pyglet/media/codecs/ffmpeg_lib/libavutil.py", line 206, in <module>
avutil.av_frame_get_best_effort_timestamp.restype = c_int64
File "/usr/lib/python3.10/ctypes/__init__.py", line 387, in __getattr__
func = self.__getitem__(name)
File "/usr/lib/python3.10/ctypes/__init__.py", line 392, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/libavutil.so.57: undefined symbol: av_frame_get_best_effort_timestamp
Exception ignored in atexit callback: <function _delete_audio_driver at 0x7f3ce5f80430>
Traceback (most recent call last):
File "/home/rj/PycharmProjects/Pytcraft/venv/lib/python3.10/site-packages/pyglet/media/drivers/__init__.py", line 102, in _delete_audio_driver
from .. import Source
File "/home/rj/PycharmProjects/Pytcraft/venv/lib/python3.10/site-packages/pyglet/media/__init__.py", line 145, in <module>
add_default_media_codecs()
File "/home/rj/PycharmProjects/Pytcraft/venv/lib/python3.10/site-packages/pyglet/media/codecs/__init__.py", line 102, in add_default_media_codecs
if have_ffmpeg():
File "/home/rj/PycharmProjects/Pytcraft/venv/lib/python3.10/site-packages/pyglet/media/codecs/__init__.py", line 124, in have_ffmpeg
from . import ffmpeg_lib
File "/home/rj/PycharmProjects/Pytcraft/venv/lib/python3.10/site-packages/pyglet/media/codecs/ffmpeg_lib/__init__.py", line 36, in <module>
from .libavcodec import *
File "/home/rj/PycharmProjects/Pytcraft/venv/lib/python3.10/site-packages/pyglet/media/codecs/ffmpeg_lib/libavcodec.py", line 46, in <module>
from . import libavutil
File "/home/rj/PycharmProjects/Pytcraft/venv/lib/python3.10/site-packages/pyglet/media/codecs/ffmpeg_lib/libavutil.py", line 206, in <module>
avutil.av_frame_get_best_effort_timestamp.restype = c_int64
File "/usr/lib/python3.10/ctypes/__init__.py", line 387, in __getattr__
func = self.__getitem__(name)
File "/usr/lib/python3.10/ctypes/__init__.py", line 392, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/libavutil.so.57: undefined symbol: av_frame_get_best_effort_timestamp
Process finished with exit code 1
r/pythonarcade • u/pvc • Mar 17 '22
Python Arcade has released version 2.6.11.
Website: https://arcade.academy
Release notes: https://api.arcade.academy/en/latest/development/release_notes.html
Demo video: https://www.youtube.com/watch?v=QClDvEwcxmg
Release notes
Special thanks to einarf, eruvanos, janscas, MrWardKKHS, DragonMoffon, pvcraven, for their contributions to this release. Also, thanks to everyone on the Pyglet team! We depend heavily on Pyglet’s continued development.
r/pythonarcade • u/einarfo • Mar 13 '22
We've been experimenting with shaders interacting with spritelist data lately and came up with a super fast way to do find sprites within a certain range taking line of sight into consideration. This is simply done by tracing the pixel data locating walls between the player and the sprite(s).

Example source : https://github.com/pythonarcade/arcade/blob/development/arcade/experimental/examples/spritelist_interaction_visualize_dist_los.py
r/pythonarcade • • Jan 31 '22
I'm working on the "Platformer" tutorlal and everything was going smoothly until I ran into this error.
"raise KeyError(f"Scene does not contain a layer named: {key}")
KeyError: 'Scene does not contain a layer named: Platforms'"
# Create the 'physics engine'
self.physics_engine = arcade.PhysicsEnginePlatformer( self.player_sprite, gravity_constant=GRAVITY, walls=self.scene["Platforms"]
under setup(self), I've compared my code with the source and I'm not finding what I did wrong. I've scanned the code for typos and syntax error etc and I'm not finding what I've done wrong.
r/pythonarcade • u/pvc • Jan 29 '22
Release notes: https://api.arcade.academy/en/latest/development/release_notes.html
Released 2022-Jan-29
Sprites
Tiled Maps
General
Documentation
arcade.gl
arcade.gui
Special thanks to Cleptomania, einarf, eruvanos, nrukin, Jayman2000, pvcraven, for their contributions to this release. Also, thanks to everyone on the Pyglet team! We depend heavily on Pyglet’s continued development.
r/pythonarcade • u/spla58 • Jan 21 '22
Hello, is there a good tutorial or example project covering best practices for the arcade library? I feel like there are a bunch of ways to do things and the tutorials seem all over the place. Trying to make a top down 2D game.
r/pythonarcade • u/keenonthedaywalker • Jan 18 '22
Hello, I am a big fan of cartography and I would like to know if I can generate maps with arcade, and if I can where should I be looking to do this?
r/pythonarcade • u/pvc • Jan 04 '22
Our new demo video, in honor of this event:
https://reddit.com/link/rvujnt/video/xqxlbpkrdo981/player
Arcade is a fast, powerful, easy-to-use 2D graphics game library.
Our website: https://arcade.academy
Over the last six years we've had:
Click here for our book on how to learn using Python and video games.
r/pythonarcade • u/0t0egeub • Nov 18 '21
How do I go about closing a window then initializing a new window? Everything I've tried either tells me that "the specified action is not allowed in the current state" or "no window is active". The set_window()) function doesn't seem to do anything to help. Alternatively, if there's a way to change the dimensions of a window programmatically after it's been initialized that would also get me out of this pickle.
r/pythonarcade • u/PhantamaroK • Nov 18 '21
I searched the API, but could not find this. I can change the window title, but not the icon (which is by default a console with the Python logo). How do I change the icon?
r/pythonarcade • u/5liced8read • Nov 14 '21
I was just wondering if it's possible to take text from a separate .txt file. For example I want to have a narrative in my game but having each line of dialogue coded within the main file would be inefficient
r/pythonarcade • u/pvc • Nov 03 '21
Arcade is an OpenGL/Pyglet based 2D-graphics game library. It can: * Handle hundreds of thousands of stationary sprites, thousands of moving sprites * Natively handle scaling, rotation, transparent pixels * Graphical shader and compute shader support * Shader-toy support * Full type-hinting * Support for cameras, views, scenes * Support for lights, tutorials for ray-casting via GPU * Hit-boxes auto-adjust around transparent pixels * Basic physics engine support built-in * Tiled map support built-in * Lots and lots of documentation and examples
Release notes are here.
Example code is here.
API docs are here.
r/pythonarcade • u/Few_Fee5926 • Oct 01 '21
Hallo! I'm just trying to get the grips and make a simple platformer. I more or less copied the example code and went from there. Now I have the 'problem' that my player sprite is not keeping up with the speed of the horizontally moving platforms and falls off after a short while, intstead of just standing there, relaxing. I have no clue, what I changed to trigger such behavior. Could there be a simple solution? Thanks for your help!
r/pythonarcade • u/tylerquacken • Sep 15 '21
Does anyone here develop with Arcade on Windows Subsystem for Linux (WSL2)? If so, I'm curious to see how you've set up your development environment, particularly with OpenGL + WSL2.
r/pythonarcade • u/pvc • Aug 30 '21
For full release notes (with pictures!), see the Arcade 2.6.0 release notes.
Released on 2021-Aug-30
Version 2.6.0 is a major update to Arcade. It is not 100% backwards compatible with the 2.5 API. Updates were made to text rendering, tiled map support, sprites, shaders, textures, GUI system, and the documentation.
Tiled Map Editor support has been overhauled.
platformer_tutorial for a how-to, Tiled usage starts at Chapter 9.
Texture atlases have been introduced, texture management has been improved.
arcade.TextureAtlas class that is used internally by SpriteList.minimap example that creates a sprite that has a dynamic minimap
projected onto it.
Revamped text rendering done by arcade.draw_text.
Rather than use Pillow to render onto an image, Arcade uses Pyglet's
text drawing system.
Text drawing is faster, higher resolution, and not prone to memory leaks. Fonts are now specifed by the
font name, rather than the file name of the font.
arcade.load_font.drawing_text example.
SpriteList optimizations.
Shadertoy support.
Shadertoy.com <https://www.shadertoy.com/>_ is a website that makes it easier to write OpenGL shaders.arcade.Shadertoy class makes it easy to run and interact with these shaders in Arcade.shader_toy_tutorial and Asteroids <https://github.com/pythonarcade/asteroids>_.

Reworked GUI



widget.with_border(...)UIBoxLayout)gui_concepts)arcade.gui.UIWidget:
arcade.gui.UIFlatButton - 2D flat button for simple interactions (hover, press, release, click)arcade.gui.UITextureButton - textured button (use :meth:arcade.load_texture()) for simple interactions (hover, press, release, click)arcade.gui.UILabel - Simple text, supports multilinearcade.gui.UIInputText - field to accept user text inputarcade.gui.UITextArea - Multiline scrollable text widget.arcade.gui.UISpriteWidget - Embeds a Sprite within the GUI treearcade.gui.UILayout:
arcade.gui.UIBoxLayout - Places widgets next to each other (vertical or horizontal)arcade.gui.UIWrapper:
arcade.gui.UIPadding - Add space around a widgetarcade.gui.UIBorder - Add border around a widgetarcade.gui.UIAnchorWidget - Used to position UIWidgets relative on screenConstructs
arcade.gui.UIMessageBox - Popup box with a message text and a few buttons.Mixins
arcade.gui.UIDraggableMixin - Makes a widget draggable.arcade.gui.UIMouseFilterMixin - Catches mouse events that occure within the widget boundaries.arcade.gui.UIWindowLikeMixin - Combination of arcade.gui.UIDraggableMixin and arcade.gui.UIMouseFilterMixin.WIP
UIWidgets contain information about preferred sizes
UILayouts can grow or shrink widgets, to adjust to different screen sizes
Scene Manager.
arcade.Scene class that can be used to manage SpriteLists and their draw order.
This can be used in place of having to draw multiple spritelists in your draw function. arcade.TileMap using :func:arcade.Scene.from_tilemap which will
automatically create an entire scene from a loaded tilemap in the proper draw order.platformer_tutorial for an introduction to this concept, and it is used heavily throughout that tutorial.Camera support
arcade.Camerasprite_move_scrolling.sprite_move_scrolling_shake.platformer_tutorial.Add a set of functions to track performance statistics. See perf_info_api.
Added the class arcade.PerfGraph, a subclass of Sprite that will graph FPS or time to process a dispatch-able
event line 'update' or 'on_draw'.

Documentation
quick_index has been reorganized to be easier to find commands, and
the individual API documentation pages have been broken into parts, so it isn't one large monolithic page.raycasting_tutorial.
* New tutorial for shader_toy_tutorial.
* Revamped tutorial: platformer_tutorial.
* Revamped minimap example: minimap.
* Moved from AWS hosting to read-the-docs hosting so we can support multiple versions of docs.
* New example showing how to use the new performance statistics API: performance_statistics_example
* New example: gui_widgets
* New example: gui_flat_button
* New example: gui_ok_messagebox
API commands
arcade.get_pixel supports getting RGB and RGBA color valuearcade.get_three_color_float Returns colors as RGB float with numbers 0.0-1.1 for each colorarcade.get_four_color_float Returns colors as RGBA float with numbers 0.0-1.1 for each color\Better PyInstaller Support
Previously our PyInstaller hook only fully functioned on Windows, with a bit of functionality on Linux. Mac was just completely unsupported and would raise an UnimplementedError if you tried.
Now we have full out of the box support for PyInstaller with Windows, Mac, and Linux.
See bundle_into_redistributable for an example of how to use it.
Sound
The sound API remains unchanged, however general stability of the sound system has been greatly improved via updates to Pyglet.
Fix for A-star path finding routing through walls
Special thanks to:
r/pythonarcade • u/hehehee69 • Aug 25 '21
How do i pass a function with parameters into the arcade.schedule method?
r/pythonarcade • u/_spaderdabomb_ • Aug 18 '21
Hey all, super happy to announce that I have fully finished a game and distributed it through itch.io. The name of the game is Bouncedown 2, and it's available to play as a download for Windows and OSX. Make sure you are on OSX 10.14+.
The game is available for free on itch.io
Download at itch.io: https://spaderdabomb.itch.io/bouncedown-2
To get involved and help improve Bouncedown join
Discord: https://discord.gg/8dKCtaQsa5
Bouncedown 2 Features
I've been programming games as a hobby on and off over the years. It's notoriously difficult to finish a game all the way through completion. Really happy to finally get one through the pipeline and get a release out, no less using Python arcade.

r/pythonarcade • u/pvc • Aug 12 '21
Arcade 2.6.0.dev5 is out as a pre-release. (You'll have to specify the version when pip-installing, or you'll get 2.5.7.) If you want to try out the new (or old) features, we'd love your feedback. Release notes: https://api.arcade.academy/en/development/development/release_notes.html
r/pythonarcade • u/pvc • Jul 23 '21
r/pythonarcade • u/pythonarcade • Jul 23 '21
How do I add double jump to my game when I have pymunk? I tried to use the line: self.physics_engine.enable_multi_jump(2) but I got the following error:AttributeError: 'PymunkPhysicsEngine' object has no attribute 'enable_multi_jump'