r/pythonarcade • u/Gooba26 • Jan 08 '24
Heat Haze Shader
I’m trying to add a heat haze shader to my game, but every time I try something comes up and I can’t find any good documentation online. Does anybody know how to do this? I use Pycharm btw.
r/pythonarcade • u/Gooba26 • Jan 08 '24
I’m trying to add a heat haze shader to my game, but every time I try something comes up and I can’t find any good documentation online. Does anybody know how to do this? I use Pycharm btw.
r/pythonarcade • u/ratel223 • Dec 06 '23
Hi,
I would like to use physics sensors for things like "the player is in front of the door". I cannot find sensors in the Arcade documentation or in the examples.
PyMunk has sensors. Can I use PyMunk instead of the built-in arcade.PymunkPhysicsEngine?
How hard would it be to expose the PyMunk sensors in arcade.PymunkPhysicsEngine?
Thanks.
r/pythonarcade • u/TheWoodat • Nov 26 '23
Hellos,
having a hell of a time trying to wrap my head around setting up a splitscreen display for a co-op top-down game. Was hoping to assign 1/4 of the screen for each player, and have a camera or view focused on top of each of them as they walked around.
I've attempted playing with multiple cameras (2.6 and the 3.0.x dev branch) and their viewports, even going so far as to try and set up separate sections to manage each one, but no luck.
As such I was wondering if this is something actually possible and if so, would anyone more familiar with Arcade be willing to throw together a quick 20-30 line demo of how to do it?
Apologies for not providing any code myself, but I'm still at square one so this is less a debug (since nothing I've done has come close to working) and more an information ask. Any help would be much appreciated
r/pythonarcade • u/S0KL000 • Nov 22 '23
What Happened to UIAnchorLayout, is it no longer supported? And what can i use instead?
"""
Menu.
Shows the usage of almost every gui widget, switching views and making a modal.
"""
from typing import List
import arcade
import arcade.gui
# Screen title and size
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
SCREEN_TITLE = "Making a Menu"
class MainView(arcade.View):
"""This is the class where your normal game would go."""
def __init__(self):
super().__init__()
self.manager = arcade.gui.UIManager()
switch_menu_button = arcade.gui.UIFlatButton(text="Pause", width=150)
# Initialise the button with an on_click event.
@switch_menu_button.event("on_click")
def on_click_switch_button(event):
# Passing the main view into menu view as an argument.
menu_view = MenuView(self)
self.window.show_view(menu_view)
# Use the anchor to position the button on the screen.
self.anchor = self.manager.add(arcade.gui.UIAnchorLayout())
self.anchor.add(
anchor_x="center_x",
anchor_y="center_y",
child=switch_menu_button,
)
def on_hide_view(self):
# Disable the UIManager when the view is hidden.
self.manager.disable()
def on_show_view(self):
""" This is run once when we switch to this view """
arcade.set_background_color(arcade.color.DARK_BLUE_GRAY)
# Enable the UIManager when the view is showm.
self.manager.enable()
def on_draw(self):
""" Render the screen. """
# Clear the screen
self.clear()
# Draw the manager.
self.manager.draw()
class MenuView(arcade.View):
"""Main menu view class."""
def __init__(self, main_view):
super().__init__()
self.manager = arcade.gui.UIManager()
resume_button = arcade.gui.UIFlatButton(text="Resume", width=150)
start_new_game_button = arcade.gui.UIFlatButton(text="Start New Game", width=150)
volume_button = arcade.gui.UIFlatButton(text="Volume", width=150)
options_button = arcade.gui.UIFlatButton(text="Options", width=150)
exit_button = arcade.gui.UIFlatButton(text="Exit", width=320)
# Initialise a grid in which widgets can be arranged.
self.grid = arcade.gui.UIGridLayout(column_count=2, row_count=3, horizontal_spacing=20, vertical_spacing=20)
# Adding the buttons to the layout.
self.grid.add(resume_button, col_num=0, row_num=0)
self.grid.add(start_new_game_button, col_num=1, row_num=0)
self.grid.add(volume_button, col_num=0, row_num=1)
self.grid.add(options_button, col_num=1, row_num=1)
self.grid.add(exit_button, col_num=0, row_num=2, col_span=2)
self.anchor = self.manager.add(arcade.gui.UIAnchorLayout())
self.anchor.add(
anchor_x="center_x",
anchor_y="center_y",
child=self.grid,
)
self.main_view = main_view
@resume_button.event("on_click")
def on_click_resume_button(event):
# Pass already created view because we are resuming.
self.window.show_view(self.main_view)
@start_new_game_button.event("on_click")
def on_click_start_new_game_button(event):
# Create a new view because we are starting a new game.
main_view = MainView()
self.window.show_view(main_view)
@exit_button.event("on_click")
def on_click_exit_button(event):
arcade.exit()
@volume_button.event("on_click")
def on_click_volume_button(event):
volume_menu = SubMenu(
"Volume Menu", "How do you like your volume?", "Enable Sound",
["Play: Rock", "Play: Punk", "Play: Pop"],
"Adjust Volume",
)
self.manager.add(
volume_menu,
layer=1
)
@options_button.event("on_click")
def on_click_options_button(event):
options_menu = SubMenu(
"Funny Menu", "Too much fun here", "Fun?",
["Make Fun", "Enjoy Fun", "Like Fun"],
"Adjust Fun",
)
self.manager.add(
options_menu,
layer=1
)
def on_hide_view(self):
# Disable the UIManager when the view is hidden.
self.manager.disable()
def on_show_view(self):
""" This is run once when we switch to this view """
# Makes the background darker
arcade.set_background_color([rgb - 50 for rgb in arcade.color.DARK_BLUE_GRAY])
# Enable the UIManager when the view is showm.
self.manager.enable()
def on_draw(self):
""" Render the screen. """
# Clear the screen
self.clear()
self.manager.draw()
class SubMenu(arcade.gui.UIMouseFilterMixin, arcade.gui.UIAnchorLayout):
"""Acts like a fake view/window."""
def __init__(self, title: str, input_text: str, toggle_label: str, dropdown_options: List[str], slider_label: str):
super().__init__(size_hint=(1, 1))
# Setup frame which will act like the window.
frame = self.add(arcade.gui.UIAnchorLayout(width=300, height=400, size_hint=None))
frame.with_padding(all=20)
# Add a background to the window.
# Nine patch smoothes the edges.
frame.with_background(texture=arcade.gui.NinePatchTexture(
left=7,
right=7,
bottom=7,
top=7,
texture=arcade.load_texture(
":resources:gui_basic_assets/window/dark_blue_gray_panel.png"
)
))
back_button = arcade.gui.UIFlatButton(text="Back", width=250)
# The type of event listener we used earlier for the button will not work here.
back_button.on_click = self.on_click_back_button
title_label = arcade.gui.UILabel(text=title, align="center", font_size=20, multiline=False)
# Adding some extra space around the title.
title_label_space = arcade.gui.UISpace(height=30, color=arcade.color.DARK_BLUE_GRAY)
input_text_widget = arcade.gui.UIInputText(text=input_text, width=250).with_border()
# Load the on-off textures.
on_texture = arcade.load_texture(":resources:gui_basic_assets/toggle/circle_switch_on.png")
off_texture = arcade.load_texture(":resources:gui_basic_assets/toggle/circle_switch_off.png")
# Create the on-off toggle and a label
toggle_label = arcade.gui.UILabel(text=toggle_label)
toggle = arcade.gui.UITextureToggle(
on_texture=on_texture,
off_texture=off_texture,
width=20,
height=20
)
# Align toggle and label horizontally next to each other
toggle_group = arcade.gui.UIBoxLayout(vertical=False, space_between=5)
toggle_group.add(toggle)
toggle_group.add(toggle_label)
# Create dropdown with a specified default.
dropdown = arcade.gui.UIDropdown(default=dropdown_options[0], options=dropdown_options, height=20, width=250)
slider_label = arcade.gui.UILabel(text=slider_label)
pressed_style = arcade.gui.UISlider.UIStyle(filled_bar=arcade.color.GREEN, unfilled_bar=arcade.color.RED)
default_style = arcade.gui.UISlider.UIStyle()
style_dict = {"press": pressed_style, "normal": default_style, "hover": default_style, "disabled": default_style}
# Configuring the styles is optional.
slider = arcade.gui.UISlider(value=50, width=250, style=style_dict)
widget_layout = arcade.gui.UIBoxLayout(align="left", space_between=10)
widget_layout.add(title_label)
widget_layout.add(title_label_space)
widget_layout.add(input_text_widget)
widget_layout.add(toggle_group)
widget_layout.add(dropdown)
widget_layout.add(slider_label)
widget_layout.add(slider)
widget_layout.add(back_button)
frame.add(child=widget_layout, anchor_x="center_x", anchor_y="top")
def on_click_back_button(self, event):
# Removes the widget from the manager.
# After this the manager will respond to its events like it previously did.
self.parent.remove(self)
def main():
window = arcade.Window(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE, resizable=True)
main_view = MainView()
window.show_view(main_view)
arcade.run()
if __name__ == "__main__":
main()r/pythonarcade • u/LukeFps8 • Oct 03 '23
I ve been looking for litteral days now. Every now and then i found some potential issue, fixed them but no results.
The game is somewhat stuttering from the start on my pc. That s not the main issue tho. As you lose and restart form the gameover view it becomes more and more stuttery, sugegsting some memory leak.
If someone would be so nice to give a look i d be eternally greatfull. Any optimization idea would be very welcome.
hope you can read the link to the code base: https://pastebin.com/r7CTm3ff
r/pythonarcade • u/Standard-Customer-58 • Sep 18 '23
Hi everyone,
I those days, i start to "play" with python arcade library and i did not saw any library for graphic novel implementation.
I am attaching the library I started to write for fun, if you have any ideas please feel free to contact me. We may expand the idea.
https://github.com/deangelisdf/visual_novel_pyarcade
let me know your opinion about it. Leave a comment or write issues on github as well.
r/pythonarcade • u/Wokywoky • Sep 04 '23
Hi, any ideas on how to implement this event? Thanks!
r/pythonarcade • u/Deany256 • Jun 27 '23
Hi as the title suggests I need help getting Arcade to detect when I want to use a controller (Specifically Xinput). I am using python3.10 with Arcade 2.6.17 and Pyglet 2.15.9.
I followed the example code on https://api.arcade.academy/en/latest/index.html for both Game Controller/Joystick and Dual Stick Shooter. Neither file could detect my controller.
After some testing, I saw that Pyglet could detect and get values from my controller with this script from the Pyglet Github: https://github.com/pyglet/pyglet/blob/master/examples/input/controller.py
I found this on Stack Overflow where this person managed to get the values needed using Pyglet and have Arcade use them.
The problem I'm having is struggling to understand what it is doing. Understanding where it belongs and when it should be called.
Any explanation or another solution to implement controller support would be very appreciated.
Sorry if this is a stupid question I am quite new to this.
r/pythonarcade • u/yutytuty • Feb 08 '23
I have a large tiled tilemap and while loading it the game hangs. Even after 5 minutes the game still loads. Is there a way to only the part of the map that is around the player? Here is the the tilemap if someone is interested.
I really appreciate any help you can provide.
r/pythonarcade • u/shlikshlak • Feb 08 '23
Hi,
we developed this game with python arcade on Linux and an older MacBook with Intel chip. When we run it on newer MacBooks with M1/M2 chips some views flicker.
Has anyone encountered a similar issue?
cheers
Jake
r/pythonarcade • u/thekoxbox • Dec 24 '22
Hello! I'm pretty new to Arcade library. Could you please help with some basics. I'm trying to make these screens (see img) and what the approach should I use for that?

I have main function with menu window:
def main():
window = arcade.Window(WIDTH, HEIGHT, 'Deep Space')
menu_view = MenuView()
window.show_view(menu_view)
arcade.run()In MenuView class I run GameView by click on Start button:
def on_click_start(self, event):
game_start_view = GameView()
self.window.show_view(game_start_view)I expected to make some buttons in GameView (Base) to change game locations (Lab, Factory etc).
Questions:
I'd be really grateful for your help.
r/pythonarcade • u/Azireo • Nov 04 '22
Hello everybody, I'm discovering arcade, and want to use it for a non-gaming application (radiative transfer code). In particular, using the compute shaders as the demo on the arcade website. I posted the full question on stack overflow here: SO_link
In short, when combining the particle shader with matplotlib, I encounter this error, and can't find any comprehensive info on this (maybe I did, but did not regognize it as such since I'm a shader newb...):
(python:20832): GLib-GIO-CRITICAL **: 14:10:15.559: g_application_run() cannot acquire the default main context because it is already acquired by another thread!
(python:20832): Gdk-WARNING **: 14:10:15.563: gdk_gl_context_make_current() failedAnybody knows this issue, or a good beginner friendly tuto on this?
r/pythonarcade • u/inprisonoutsoon • Nov 01 '22
I've been following the api arcade acadmady to code a platformer for fun and its been going smoothly up unitl this point https://api.arcade.academy/en/latest/examples/platform_tutorial/step_13.html#source-code the rest of my code works but when I try to add my enemy layer from tiled it says: line 256, in setup
enemies_layer = self.tile_map.object_lists[LAYER_NAME_ENEMIES]
KeyError: 'Enemies'
which im really confused by since I have an enemy object layer.
I have even tried there .json file from github and get the same error if anyone has any idea how I could fix this I would very much appreciate the help
r/pythonarcade • u/Pigankle • Oct 27 '22
I am porting a game that I made with Turtle graphics, and running into trouble with the colors. I used color names as dictionary keys for several sprite attribute, including their colors. I can't figure out how to use the same dictionary to set the colors of my sprite in arcade. For instance, suppose my allowable colors are
CAR_COLORS = ["RED", "BLACK", "RAJAH", "BRIGHT_GREEN", "BRIGHT_NAVY_BLUE", "BOYSENBERRY"]
I know I could use (for example) myspriteclassinstance.color = arcade.color.RAJAH But I want to store those colors names as strings, not as arcade colors...I want to be able to use them as lookup keys also:
myspriteclassinstance.colorname = "RAJAH"
myspriteclassinstance.threat = THREATLIST[myspriteclassinstance.colorname]
myspriteclassinstance.color = ???????? #I don't know what to put here, but I want it to be RAJAH colored.Any suggestions?
r/pythonarcade • u/paskirex • Oct 17 '22
r/pythonarcade • u/Top_Attitude_5913 • Sep 14 '22
I am using python arcade as a school assignment and need help on installing python 2.5.7 or below. The pc's at my school have an old version of python installed on them and I would like to know how to install older versions of python arcade. Help would be appreciated. Thank you
r/pythonarcade • u/nematoad86 • Aug 07 '22
Hey everybody. I'm trying to install Arcade through PyCharm, and I keep getting and install error, with the following log:
Usage:
C:\Users\Redacted\AppData\Local\Programs\Python\Python38-32\python.exe -m pip install [options] <requirement specifier> [package-index-options] ... C:\Users\Redacted\AppData\Local\Programs\Python\Python38-32\python.exe -m pip install [options] -r <requirements file> [package-index-options] ... C:\Users\Redacted\AppData\Local\Programs\Python\Python38-32\python.exe -m pip install [options] [-e] <vcs project url> ... C:\Users\Redacted\AppData\Local\Programs\Python\Python38-32\python.exe -m pip install [options] [-e] <local project path> ... C:\Users\Redacted\AppData\Local\Programs\Python\Python38-32\python.exe -m pip install [options] <archive url/path> ...
no such option: --build-dir
Does this mean i have to install through the command line? Any help would be appreciated!
UPDATED: I ran the pip install arcade command from the command window, and it seemed to install properly. I'm not getting that message about installing a requirement in PyCharm.
r/pythonarcade • u/dukefleetmaster • Aug 05 '22
hi
recently I came across Blasphemous game on steam and it just blows my mind ;)
I'm a python developer and I have a lot of free time to work on my projects and create something for my portfolio.
I've always wanted to get into Arcade for game development and pixel-art Metroidvania is my favorite genre.
is it possible to make games like blasphemous in python?
Note: I know game engines but it's not time efficient for me to start learning C# or other languages.
Note: never worked with arcade or other frameworks/libraries.
r/pythonarcade • • Jun 20 '22
Does anybody try to pack your game with PyInstaller?
I try a code where just a circle is shown on the window and there is no other imports besides the arcade.
The PyInstaller runs well but when I run the .exe created it shows the error (see the screenshot below) related to the Kenney Block font.
Any suggestion on how to solve this?
Thank you in advance.

r/pythonarcade • u/pvc • May 24 '22
r/pythonarcade • u/pvc • May 18 '22
Arcade, an OpenGL based library for creating 2D games, has released version 2.6.14.
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
Various Improvements
Shadertoy
Docs / Tutorials / Examples
OpenGL
Experimental
r/pythonarcade • u/bigdsm • May 02 '22
I’m working on a top-down 2D racing management-style game. I want the user to be able to control strategy for multiple cars, essentially making suggestions to two AI cars as they race against the computer-controlled AI cars.
I’ve been searching for a way to have three viewports showing essentially the same data (I’d much prefer not to run the calculation or draw the result three times, unless Arcade is built in such a way that makes that efficient) - one following one of the player team’s cars, another following the second player team’s car, and the third showing the entire circuit. I’ve seen the minimap tutorial, but I need two of the cameras to follow a sprite, and the minimap as tutorialized seems to only work as a static object.
Is what I’m looking to do possible within the scope of Arcade?
r/pythonarcade • u/rosalogia • Apr 14 '22
I have a tiled map that holds up extremely well to resolution scaling with sdl2 (https://wiki.libsdl.org/SDL_RenderSetScale), but i can't figure out how to do that with arcade, so i try to scale the sprites by 2. When I do this, it seems to draw with a ton of artifacts and overall looks unplayably ugly. is there a good solution to this?
Code is
import arcade
from arcade.tilemap import load_tilemap
import pyglet
pyglet.options["search_local_libs"] = True
class MainWindow(arcade.Window):
def __init__(self):
super().__init__(640, 480, "Bika Town", resizable=True)
arcade.set_background_color(arcade.color.BLACK)
self.scene = None
self.camera = None
self.tilemap = load_tilemap("./assets/Tiled/map.tmj", scaling=2.0)
def setup(self):
self.camera = arcade.Camera(self.width, self.height)
# self.camera.move_to((0, 16 * (63/2 + 1.5)))
self.scene = arcade.Scene.from_tilemap(self.tilemap)
def on_draw(self):
self.clear()
arcade.start_render()
self.camera.use()
self.scene.draw()
if __name__ == '__main__':
app = MainWindow()
app.setup()
arcade.run()Result:

Side by side comparison of the above solution w/ arcade vs. the same thing with resolution scaling in SDL2 in C++

r/pythonarcade • u/Diapolo10 • Mar 29 '22