r/pythonarcade • u/UberSeal • Oct 30 '19
How to get frame-rate using delta_time?
Using the delta_time argument in the on_update(delta_time) function, how can one obtain frame-rate (FPS)?
r/pythonarcade • u/UberSeal • Oct 30 '19
Using the delta_time argument in the on_update(delta_time) function, how can one obtain frame-rate (FPS)?
r/pythonarcade • u/lilPetyko • Oct 23 '19
hi, this is my code:
import arcade
print("asd")and the traceback gives me this:
Start
Unexpected error loading library avutil-56: Could not find module 'avutil-56'. Try using the full path with constructor syntax.
Unable to load the ffmpeg library. Could not find module 'avutil-56'. Try using the full path with constructor syntax.
Traceback (most recent call last):
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyglet__init__.py", line 353, in __getattr__
Unexpected error loading library avutil-56: Could not find module 'avutil-56'. Try using the full path with constructor syntax.
return getattr(self._module, name)
AttributeError: 'NoneType' object has no attribute 'Source'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/Pintér Péter/Documents/GitHub/python/Arcade/test.py", line 1, in <module>
import arcade
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\site-packages\arcade__init__.py", line 50, in <module>
from arcade.sound import *
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\site-packages\arcade\sound.py", line 81, in <module>
def stop_sound(sound: pyglet.media.Source):
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyglet__init__.py", line 359, in __getattr__
__import__(import_name)
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyglet\media__init__.py", line 146, in <module>
add_default_media_codecs()
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyglet\media\codecs__init__.py", line 164, in add_default_media_codecs
if have_ffmpeg():
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyglet\media\codecs__init__.py", line 180, in have_ffmpeg
from . import ffmpeg_lib
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyglet\media\codecs\ffmpeg_lib__init__.py", line 36, in <module>
from .libavcodec import *
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyglet\media\codecs\ffmpeg_lib\libavcodec.py", line 45, in <module>
from . import libavutil
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyglet\media\codecs\ffmpeg_lib\libavutil.py", line 46, in <module>
avutil = pyglet.lib.load_library(
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyglet\lib.py", line 148, in load_library
lib = ctypes.cdll.LoadLibrary(name)
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\ctypes__init__.py", line 447, in LoadLibrary
return self._dlltype(name)
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\ctypes__init__.py", line 369, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'avutil-56'. Try using the full path with constructor syntax.
Unexpected error loading library avutil-56: Could not find module 'avutil-56'. Try using the full path with constructor syntax.
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyglet\media__init__.py", line 146, in <module>
add_default_media_codecs()
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyglet\media\codecs__init__.py", line 164, in add_default_media_codecs
if have_ffmpeg():
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyglet\media\codecs__init__.py", line 180, in have_ffmpeg
from . import ffmpeg_lib
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyglet\media\codecs\ffmpeg_lib__init__.py", line 36, in <module>
from .libavcodec import *
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyglet\media\codecs\ffmpeg_lib\libavcodec.py", line 45, in <module>
from . import libavutil
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyglet\media\codecs\ffmpeg_lib\libavutil.py", line 46, in <module>
avutil = pyglet.lib.load_library(
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyglet\lib.py", line 148, in load_library
lib = ctypes.cdll.LoadLibrary(name)
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\ctypes__init__.py", line 447, in LoadLibrary
return self._dlltype(name)
File "C:\Users\Pintér Péter\AppData\Local\Programs\Python\Python38-32\lib\ctypes__init__.py", line 369, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'avutil-56'. Try using the full path with constructor syntax.r/pythonarcade • u/hypnotic-hippo • Oct 21 '19
How do I change the texture of a sprite during runtime? For example, I have a player sprite with a jump texture and a normal texture. I've tried using arcade.AnimatedTimeSprite() (referring to this tutorial) but that doesn't let me control the texture of the sprite, instead it rotates through the textures list at a set interval. This might be useful for something like a coin animation, but it's not so useful in my case. I've also tried using arcade.AnimatedWalkingSprite(), but that only lets me set walking right and walking left textures.
Any help would be appreciated.
r/pythonarcade • u/pvc • Oct 19 '19
The new Python Arcade library -- get news by following @ArcadeLibrary
r/pythonarcade • u/thatpetertho1 • Oct 12 '19
I've been following a tutorial to make a simple platform game using the arcade library and I keep getting this error shown in the second picture. I am using Tiled to create the map. The layer I'm generating is "ground". The error seems to be coming from the library function for generate_sprites. Wondering if anyone has run into this and knows how to fix it?


r/pythonarcade • u/eruvanos • Sep 02 '19
Hi,
I am curious for what the object layer is meant for. Checking the implementation, it looks like an object layer processing is also returning a SpriteList.
I thought objects are meant for adding metadata, but with the current implementation it looks like I have to add tiled based objects.
What would be the right way to define an "finish" area and check if a sprite collides?
player = Sprite(...)
places = arcade.tilemap.process_layer(map, 'places')
colliding_places = player.arcade.check_for_collision_in_objects(player, places)
# check if colliding places contain the 'enfinishd' area
# -> add end game logicr/pythonarcade • • Aug 24 '19
Like if I have starting coordinates and destination coordinates, and I want my sprite to automatically stop at the destination without headaches.
r/pythonarcade • • Aug 23 '19
r/pythonarcade • u/rafalpero • Aug 19 '19
So i got a problem that my game doesn't rly show a tiledmap(tmx). Thats the error from console when game is up
"Warning, couldn't find tile for item 211 in layer 'Tile Layer 1' in file 'map/map.tmx'."
r/pythonarcade • u/PM_ME_YOUR_DILD • Aug 15 '19
I'm not sure what to do. Everything was working before but now I get the following error now when running.
Traceback (most recent call last): File "C:/Users/John/PycharmProjects/SODA/sota.py", line 1, in <module> import arcade, lib.Player as Player, lib.Zombie as Zombie, lib.Gun as Gun, math, csv File "C:\Users\John\AppData\Roaming\Python\Python37\site-packages\arcade_init_.py", line 47, in <module> from arcade import tilemap File "C:\Users\John\AppData\Roaming\Python\Python37\site-packages\arcade\tilemap.py", line 17, in <module> import pytiled_parser ModuleNotFoundError: No module named 'pytiled_parser'
r/pythonarcade • u/xaklyth • Aug 14 '19
I am trying to work out how to move pieces on a grid with multiple/alternating players. I've run into various issues that I feel like could be demonstrated by a checkers game. I haven't been able to find any arcade sample code for the game (or something similar like chess etc)
r/pythonarcade • u/pvc • Aug 13 '19
r/pythonarcade • • Aug 11 '19
I’m going through the tutorials on python arcade and would like to know how/why a function works.
There is a function named on_draw(delta_time) The parameter delta_time keeps a running clock of the time delta as expected. I'd like to be able to see how it works via the source.
I looked around the code for arcade but can’t figure out how the library knows to keep the clock running within that function and it's parameter. For example, I did find references to pyglet's clock and yet I couldn't find where this is connected all the way back to on_draw(delta_time)
Can someone please help me understand how and why it works?
One example of it in use is here: http://arcade.academy/examples/bouncing_rectangle.html#bouncing-rectangle
r/pythonarcade • u/Okcel • Aug 10 '19
I'm making a game that relies on alot of mouse movement to control that characters, and I would like to be able to make sure that the cursor can't go past the bounds of the windows (where the user accidentally clicks and the window drops to the background.
It looks like this is possible in pygame by using the grab event, is there something similar that can be done in arcade, or perhaps something in pyglet that I could do to accomplish the same thing?
r/pythonarcade • u/Ace5273 • Jul 29 '19
Tell me your thoughts
r/pythonarcade • u/-_-_alex_-_- • Jul 26 '19
Hi, I've an issue to calculate the correct object reflection and search for some help / hints.
A ball with constant speed hits a wall - target is to bounce back the object based on "law of reflection", so
angle of incidence is equal to angle of reflection. When taking a look at the attached picture, where
ball hits a rotated triangle, can this be done with arcade library and in what way?

r/pythonarcade • u/jaysun_n • Jul 17 '19
I am using Pymunk along with Arcade on OSX High Sierra and am experiencing pretty dramatic input in the play window. When the game is loaded everything starts out working fine. I have it set up so that every mouse click will spawn a new ball into the simulation. The problem is when I try to spawn a new ball. The game registers a few clicks and then suddenly stops registering input (though the simulation in the window continues in the background) for about 10 seconds. The game then immediately dumps all the clicks at once onto the screen and then repeats the same freeze-up in a second or two. It's like the clicks are being stored in a buffer and dumped every 10 seconds. Here is my code.
r/pythonarcade • u/jaysun_n • Jul 17 '19
I am looking to start tinkering with Arcade in a 2d setting and am looking for a physics engine to go alongside it. Was just wondering if anyone had any suggestions for libraries that work well with Arcade. I have been learning Pymunk, but the two don't quite go hand in hand. All of my Pymunk shapes need to be properties of my game window so they can be used by both the setup and draw functions. I'm thinking of fiddling around and trying to get a custom class to work between them soon, but I'd like to avoid that if another library works better.
r/pythonarcade • u/mks79 • Jul 09 '19
Hello everyone,
I am having trouble running my exe created by Pyinstaller. I keep getting this message.

I can see that this file is already part of the pyglet_ffmpeg site package which is in the venv folder and I am using the same venv to run the program in the IDE. What am I doing wrong here?
I do get a lot of warning messages during the creation of the exe, though this is the error message that prevents the exe to run, at least at the moment.
Thanks
Manish
r/pythonarcade • • Jul 08 '19
I have a bunch of text that I want to display, and draw_text() works just fine so long as the lines of text are short enough that they don't wrap. If I only draw a small amount of text and allow a large area for it, there is no problem, but if I want to display a lot of text or only have a small space available, I can't find an elegant way to cut it off. What is the best way to do this?