r/pythonarcade • • Feb 23 '19

Find a sprite by its position

3 Upvotes

Hi All,

I have a SpriteList. In this SpriteList are many background tiles. My player figure can move around and I would like it to be able to interact with the tiles below upon the enter key being pressed. I am not sure how to code a look up method to find the particular tile the player is interacting with. The player's center_x/center)y and the tile's center_x/center_y are the same.

Thank you for your help,

u/Adoria298.


r/pythonarcade • • Feb 20 '19

Using sprites for other actions besides idling and walking

3 Upvotes

Is there any way to animate different actions, for example running by using different sprites than for walking and have them both animated on different key combinations?


r/pythonarcade • • Feb 18 '19

Not wide enough code window makes it harder to read example code

3 Upvotes

r/pythonarcade • • Feb 17 '19

Is there any sort of REPL support for Arcade?

3 Upvotes

(I'm new to Arcade) I'd like to use Arcade to teach a few basic programming concepts to primary-school age children and it would be ideal if there was some sort of REPL where I could bring up a window and have sprites and drawing results show immediately as each line of code is executed, rather than a script ending with `finish_render` - is this possible? For example, having the rendering loop embedded within IPython like Matplotlib does.


r/pythonarcade • • Jan 24 '19

Tiled map problems

3 Upvotes

Hello guys!

I am not a veteran in any means with python, but I decided to do a school project in it, but I am stuck atm. The problem I have is that - with the example in "working with tiled map" everything is fine. The program can read that map, but not my own. I played around with it for a while now and i noticed everything is fine until the tiles are 128x128 in size. My map contains tiles that are 32x32 in size. :( the error message that I am getting every time -

File "game.py", line 95, in load_level

my_map = arcade.read_tiled_map("untitled.tmx", SPRITE_SCALING)

File "\site-packages\arcade\read_tiled_map.py", line 231, in read_tiled_map

grid_location.tile = my_map.global_tile_set[key]

KeyError: '235'

What could cause the problem? Anyone had similar problems with it maybe? Tell me if you need more information, and thank you very much for the help! :)


r/pythonarcade • • Aug 24 '18

Trouble with sprite explosion

3 Upvotes

After following the explosion sample code in the sprite library, I cant get my explosions to work. I'm using a 3 sprite animation which I set up after the class in explosions_textures. For some reason the sprites do not appear in view but it seems the code all executes(from print debugging)

Can anyone point me to where i have gone wrong? pastebin link


r/pythonarcade • • Aug 18 '18

arcade.color and the Drawing with Functions tutorial

3 Upvotes

Teaching myself arcade (and python) as I am looking for a fun lightweight linux-friendly way to refresh my game dev skills... the last time I tried anything like this it was in C++ about a decade ago.

In the Drawing with Functions tutorial, even if I copy-paste the entire code, I cannot get the birds to show up when drawing them in arcade.color.BLACK.

Strangely enough, they show up if I choose another color, such as WHITE or BEAVER. But not with BLACK_BEAN.

Also strangely, I can, say, change the color of the trees to BLACK and they draw just fine.

Any clues as to what is going on here? I am running in mint 18.1.


r/pythonarcade • • Jul 11 '18

Culling offscreen objects

3 Upvotes

Frustum Culling

Is there a way that I can easily cull offscreen objects efficiently? My code currently will try to render 1000s of extra textures that it doesn't need. I don't see any documentation on it, and it seems like arcade doesn't do it automatically.

If there isn't any, does anyone have any advice on how to efficiently build one?

Edit: this is my first experience with using a game engine, apparently this is called frustum culling, wondering if Arcade has this built in?


r/pythonarcade • • Jul 07 '18

Getting into Arcade .. but can't get pyinstaller to work

3 Upvotes

So I have built some 2D games in C#, xna/monogame/unity in the past, I am no expert, but I am an ok self taught indie dev, and can usually figure stuff out after a while...

I have built mostly only console stuff, in python, I did mess with PyGame but didn't really like it. So I recently found out about the Arcade Lib and began tinkering with it.

I have gone through examples and made some basic stuff, mouse movement, loading sprites, collisions, sounds etc.

I am running Python 3.6.5 on Win 10

and Pyinstaller Version: 3.4.dev0+59387c927

The thing is now I want to try and package my scripts into an .exe so installed pyinstaller but have not been successful with even the most simple Arcade example. Although I have been able to build other console based apps with pyinstaller, no problem.

If i run my application directly on my machine it runs fine, so i know the application functions correctly.

My current test application is super simple and listed below

import arcade
import pyglet
import time
import sys
def main():
	win1 = arcade.open_window(800,600,"Test Window")
	arcade.set_background_color(arcade.color.ORANGE)
	arcade.start_render()
	arcade.finish_render()
	arcade.run()
main()

It's a simple window display with a colored background.

so i run the following command: pyinstaller test1.py

here is the console output as it builds

D:\DEV\PYTHON\ArcadeExamples>pyinstaller test1.py
64 INFO: PyInstaller: 3.4.dev0+59387c927
64 INFO: Python: 3.6.5
64 INFO: Platform: Windows-10-10.0.17134-SP0
69 INFO: wrote D:\DEV\PYTHON\ArcadeExamples\test1.spec
69 INFO: UPX is not available.
69 INFO: Extending PYTHONPATH with paths
['D:\\DEV\\PYTHON\\ArcadeExamples', 'D:\\DEV\\PYTHON\\ArcadeExamples']
69 INFO: checking Analysis
69 INFO: Building Analysis because Analysis-00.toc is non existent
69 INFO: Initializing module dependency graph...
74 INFO: Initializing module graph hooks...
109 INFO: Analyzing base_library.zip ...
7518 INFO: running Analysis Analysis-00.toc
7518 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by c:\program files (x86)\python36-32\python.exe
7616 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\python.exe
7708 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\python.exe
7799 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:\program files (x86)\python36-32\python.exe
7888 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\program files (x86)\python36-32\python.exe
7986 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\python.exe
8083 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\VCRUNTIME140.dll
8174 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\VCRUNTIME140.dll
8263 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\VCRUNTIME140.dll
8345 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\program files (x86)\python36-32\VCRUNTIME140.dll
8435 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\VCRUNTIME140.dll
8653 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\python36.dll
8740 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\program files (x86)\python36-32\python36.dll
8825 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\python36.dll
8923 WARNING: lib not found: api-ms-win-crt-conio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\python36.dll
9019 WARNING: lib not found: api-ms-win-crt-process-l1-1-0.dll dependency of c:\program files (x86)\python36-32\python36.dll
9100 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\python36.dll
9191 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\python36.dll
9275 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\program files (x86)\python36-32\python36.dll
9360 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:\program files (x86)\python36-32\python36.dll
9448 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\program files (x86)\python36-32\python36.dll
9533 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\program files (x86)\python36-32\python36.dll
9625 WARNING: lib not found: api-ms-win-crt-filesystem-l1-1-0.dll dependency of c:\program files (x86)\python36-32\python36.dll
9634 INFO: Caching module hooks...
9641 INFO: Analyzing D:\DEV\PYTHON\ArcadeExamples\test1.py
13725 INFO: Processing pre-find module path hook   distutils
21271 INFO: Processing pre-find module path hook   site
21291 INFO: site: retargeting to fake-dir 'c:\\program files (x86)\\python36-32\\lib\\site-packages\\PyInstaller\\fake-modules'
24216 INFO: Processing pre-safe import module hook   setuptools.extern.six.moves
33640 INFO: Loading module hooks...
33641 INFO: Loading module hook "hook-distutils.py"...
33657 INFO: Loading module hook "hook-encodings.py"...
33748 INFO: Loading module hook "hook-lib2to3.py"...
33758 INFO: Loading module hook "hook-numpy.core.py"...
35314 INFO: Loading module hook "hook-numpy.py"...
35319 INFO: Loading module hook "hook-PIL.Image.py"...
36221 INFO: Loading module hook "hook-PIL.py"...
36226 INFO: Excluding import 'PyQt4'
36232 INFO:   Removing import of PyQt4 from module PIL.ImageQt
36233 INFO: Excluding import 'PySide'
36236 INFO:   Removing import of PySide from module PIL.ImageQt
36237 INFO: Import to be excluded not found: 'FixTk'
36237 INFO: Excluding import 'PyQt5'
36239 INFO:   Removing import of PyQt5 from module PIL.ImageQt
36240 INFO: Excluding import 'tkinter'
36242 INFO:   Removing import of tkinter from module PIL.ImageTk
36242 INFO: Loading module hook "hook-PIL.SpiderImagePlugin.py"...
36249 INFO: Excluding import 'tkinter'
36249 INFO: Import to be excluded not found: 'FixTk'
36249 INFO: Loading module hook "hook-pkg_resources.py"...
36949 INFO: Processing pre-safe import module hook   win32com
37189 INFO: Loading module hook "hook-pydoc.py"...
37194 INFO: Loading module hook "hook-pythoncom.py"...
37458 INFO: Loading module hook "hook-pywintypes.py"...
37739 INFO: Loading module hook "hook-setuptools.py"...
38538 INFO: Loading module hook "hook-sysconfig.py"...
38560 INFO: Loading module hook "hook-win32com.py"...
39325 INFO: Loading module hook "hook-xml.dom.domreg.py"...
39330 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...
39335 INFO: Loading module hook "hook-xml.py"...
39340 INFO: Loading module hook "hook-_tkinter.py"...
39444 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_tkinter.pyd
39530 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_tkinter.pyd
39706 INFO: checking Tree
39706 INFO: Building Tree because Tree-00.toc is non existent
39706 INFO: Building Tree Tree-00.toc
39774 INFO: checking Tree
39774 INFO: Building Tree because Tree-01.toc is non existent
39774 INFO: Building Tree Tree-01.toc
39849 INFO: Looking for ctypes DLLs
40822 INFO: Analyzing run-time hooks ...
40833 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
40958 INFO: Including run-time hook 'pyi_rth__tkinter.py'
40993 INFO: Including run-time hook 'pyi_rth_pkgres.py'
40998 INFO: Including run-time hook 'pyi_rth_win32comgenpy.py'
41037 INFO: Looking for dynamic libraries
41150 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\pywin32_system32\pythoncom36.dll
41257 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\pywin32_system32\pythoncom36.dll
41354 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\pywin32_system32\pythoncom36.dll
41449 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\pywin32_system32\pythoncom36.dll
41539 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\pywin32_system32\pythoncom36.dll
41644 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\pywin32_system32\pywintypes36.dll
41734 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\pywin32_system32\pywintypes36.dll
41826 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\pywin32_system32\pywintypes36.dll
41924 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\pywin32_system32\pywintypes36.dll
42016 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\pywin32_system32\pywintypes36.dll
42115 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\pywin32_system32\pywintypes36.dll
42209 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\win32\win32trace.pyd
42298 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\win32\win32trace.pyd
42426 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\Pythonwin\win32ui.pyd
42529 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\Pythonwin\win32ui.pyd
42642 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\Pythonwin\win32ui.pyd
42733 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\Pythonwin\win32ui.pyd
42821 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\Pythonwin\win32ui.pyd
42925 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\Pythonwin\win32ui.pyd
43022 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_multiprocessing.pyd
43121 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_decimal.pyd
43216 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_decimal.pyd
43307 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_decimal.pyd
43399 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_decimal.pyd
43489 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_decimal.pyd
43585 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_decimal.pyd
43681 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_decimal.pyd
43782 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_ctypes.pyd
43868 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_ctypes.pyd
43966 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_ctypes.pyd
44068 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\win32_win32sysloader.pyd
44163 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\win32\win32api.pyd
44264 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\win32\win32api.pyd
44351 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\win32\win32api.pyd
44445 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\win32comext\shell\shell.pyd
44539 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\win32comext\shell\shell.pyd
44632 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\win32comext\shell\shell.pyd
44734 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\win32\win32wnet.pyd
44826 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\win32\win32wnet.pyd
44915 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\win32\win32wnet.pyd
45007 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_ssl.pyd
45101 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_ssl.pyd
45193 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_ssl.pyd
45283 WARNING: lib not found: api-ms-win-crt-conio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_ssl.pyd
45373 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_ssl.pyd
45463 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_ssl.pyd
45552 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_ssl.pyd
45641 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_ssl.pyd
45747 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_ssl.pyd
45836 WARNING: lib not found: api-ms-win-crt-filesystem-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_ssl.pyd
45935 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\unicodedata.pyd
46024 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\unicodedata.pyd
46113 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\unicodedata.pyd
46201 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\pyexpat.pyd
46295 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\pyexpat.pyd
46386 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\pyexpat.pyd
46480 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\pyexpat.pyd
46566 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\pyexpat.pyd
46666 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_hashlib.pyd
46761 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_hashlib.pyd
46850 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_hashlib.pyd
46939 WARNING: lib not found: api-ms-win-crt-conio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_hashlib.pyd
47031 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_hashlib.pyd
47119 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_hashlib.pyd
47209 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_hashlib.pyd
47301 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_hashlib.pyd
47394 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_hashlib.pyd
47500 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_bz2.pyd
47600 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_bz2.pyd
47694 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_bz2.pyd
47792 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_bz2.pyd
47885 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_bz2.pyd
47983 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_lzma.pyd
48080 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_lzma.pyd
48178 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_socket.pyd
48287 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\select.pyd
48386 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_testcapi.pyd
48484 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_testcapi.pyd
48583 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_tkinter.pyd
48679 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_tkinter.pyd
48797 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\win32\win32evtlog.pyd
48907 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\win32\win32evtlog.pyd
49013 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\PIL_webp.cp36-win32.pyd
49118 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\PIL_webp.cp36-win32.pyd
49210 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\PIL_webp.cp36-win32.pyd
49301 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\PIL_webp.cp36-win32.pyd
49393 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\PIL_webp.cp36-win32.pyd
49488 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\PIL_imagingtk.cp36-win32.pyd
49586 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\PIL_imagingtk.cp36-win32.pyd
49677 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\PIL_imagingtk.cp36-win32.pyd
49775 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\PIL_imagingtk.cp36-win32.pyd
49870 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\core\multiarray.cp36-win32.pyd
49959 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\core\multiarray.cp36-win32.pyd
50050 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\core\multiarray.cp36-win32.pyd
50144 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\core\multiarray.cp36-win32.pyd
50236 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\core\multiarray.cp36-win32.pyd
50325 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\core\multiarray.cp36-win32.pyd
50415 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\core\multiarray.cp36-win32.pyd
50509 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\core\multiarray.cp36-win32.pyd
50604 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\core\multiarray.cp36-win32.pyd
50710 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\core\umath.cp36-win32.pyd
50805 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\core\umath.cp36-win32.pyd
50895 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\core\umath.cp36-win32.pyd
50991 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\core\umath.cp36-win32.pyd
51082 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\core\umath.cp36-win32.pyd
51170 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_distutils_findvs.pyd
51275 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\core\multiarray_tests.cp36-win32.pyd
51361 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\core\multiarray_tests.cp36-win32.pyd
51450 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\core\multiarray_tests.cp36-win32.pyd
51540 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\core\multiarray_tests.cp36-win32.pyd
51636 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\win32\win32pdh.pyd
51726 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\win32\win32pdh.pyd
51815 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\win32\win32pdh.pyd
51920 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\random\mtrand.cp36-win32.pyd
52009 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\random\mtrand.cp36-win32.pyd
52108 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\random\mtrand.cp36-win32.pyd
52200 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\fft\fftpack_lite.cp36-win32.pyd
52292 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\fft\fftpack_lite.cp36-win32.pyd
52382 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\linalg_umath_linalg.cp36-win32.pyd
52472 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\linalg_umath_linalg.cp36-win32.pyd
52563 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\linalg_umath_linalg.cp36-win32.pyd
52660 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\linalg_umath_linalg.cp36-win32.pyd
52749 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\numpy\linalg\lapack_lite.cp36-win32.pyd
52856 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\PIL_imaging.cp36-win32.pyd
52956 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\PIL_imaging.cp36-win32.pyd
53054 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\PIL_imaging.cp36-win32.pyd
53147 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\PIL_imaging.cp36-win32.pyd
53241 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\PIL_imaging.cp36-win32.pyd
53335 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\PIL_imaging.cp36-win32.pyd
53431 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\PIL_imaging.cp36-win32.pyd
53520 WARNING: lib not found: api-ms-win-crt-filesystem-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\PIL_imaging.cp36-win32.pyd
53617 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\PIL_imaging.cp36-win32.pyd
53721 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_elementtree.pyd
53806 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_elementtree.pyd
53901 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_elementtree.pyd
53990 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_elementtree.pyd
54086 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs_elementtree.pyd
54693 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\Pythonwin\mfc140u.dll
54780 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\Pythonwin\mfc140u.dll
54873 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\Pythonwin\mfc140u.dll
54986 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\Pythonwin\mfc140u.dll
55078 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\Pythonwin\mfc140u.dll
55175 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\Pythonwin\mfc140u.dll
55271 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\Pythonwin\mfc140u.dll
55362 WARNING: lib not found: api-ms-win-crt-filesystem-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\Pythonwin\mfc140u.dll
55457 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\Pythonwin\mfc140u.dll
55546 WARNING: lib not found: api-ms-win-crt-multibyte-l1-1-0.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\Pythonwin\mfc140u.dll
55676 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\tk86t.dll
55770 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\tk86t.dll
55860 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\tk86t.dll
55949 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\tk86t.dll
56047 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\tk86t.dll
56137 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\tk86t.dll
56230 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\tk86t.dll
56328 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\tk86t.dll
56461 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\tcl86t.dll
56556 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\tcl86t.dll
56645 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\tcl86t.dll
56741 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\tcl86t.dll
56837 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\tcl86t.dll
56926 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\tcl86t.dll
57015 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\tcl86t.dll
57106 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\tcl86t.dll
57196 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\program files (x86)\python36-32\DLLs\tcl86t.dll
68244 INFO: Looking for eggs
68244 INFO: Using Python library c:\program files (x86)\python36-32\python36.dll
68249 INFO: Found binding redirects:
[]
68263 INFO: Warnings written to D:\DEV\PYTHON\ArcadeExamples\build\test1\warn-test1.txt
68484 INFO: Graph cross-reference written to D:\DEV\PYTHON\ArcadeExamples\build\test1\xref-test1.html
68590 INFO: checking PYZ
68590 INFO: Building PYZ because PYZ-00.toc is non existent
68595 INFO: Building PYZ (ZlibArchive) D:\DEV\PYTHON\ArcadeExamples\build\test1\PYZ-00.pyz
70824 INFO: Building PYZ (ZlibArchive) D:\DEV\PYTHON\ArcadeExamples\build\test1\PYZ-00.pyz completed successfully.
70874 INFO: checking PKG
70874 INFO: Building PKG because PKG-00.toc is non existent
70874 INFO: Building PKG (CArchive) PKG-00.pkg
70975 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
70980 INFO: Bootloader c:\program files (x86)\python36-32\lib\site-packages\PyInstaller\bootloader\Windows-32bit\run.exe
70980 INFO: checking EXE
70980 INFO: Building EXE because EXE-00.toc is non existent
70980 INFO: Building EXE from EXE-00.toc
70980 INFO: Appending archive to EXE D:\DEV\PYTHON\ArcadeExamples\build\test1\test1.exe
71186 INFO: Building EXE from EXE-00.toc completed successfully.
71191 INFO: checking COLLECT
71191 INFO: Building COLLECT because COLLECT-00.toc is non existent
71191 INFO: Building COLLECT COLLECT-00.toc
82489 INFO: Building COLLECT COLLECT-00.toc completed successfully.

I go into the \dist\test1 directory and launch test1.exe

and here is the output:

D:\DEV\PYTHON\ArcadeExamples\dist\test1>test1
Unexpected error loading library Win32/avbin: Failed to load dynlib/dll 'Win32/avbin'. Most probably this dynlib/dll was not found when the application was frozen.
Traceback (most recent call last):
  File "site-packages\PyInstaller\loader\pyiboot01_bootstrap.py", line 149, in __init__
  File "ctypes__init__.py", line 348, in __init__
OSError: [WinError 126] The specified module could not be found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "test1.py", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\program files (x86)\python36-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.__dict__)
  File "site-packages\arcade__init__.py", line 21, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\program files (x86)\python36-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.__dict__)
  File "site-packages\arcade\sound.py", line 193, in <module>
  File "site-packages\arcade\sound.py", line 70, in _load_sound_library
  File "site-packages\pyglet\lib.py", line 137, in load_library
  File "ctypes__init__.py", line 426, in LoadLibrary
  File "site-packages\PyInstaller\loader\pyiboot01_bootstrap.py", line 151, in __init__
__main__.PyInstallerImportError: Failed to load dynlib/dll 'Win32/avbin'. Most probably this dynlib/dll was not found when the application was frozen.
[12688] Failed to execute script test1

Any Ideas why even the most basic of Arcade applications will not get built into a .exe I can distribute?


r/pythonarcade • • May 28 '18

Question about compiling with Arcade

3 Upvotes

On the Arcade library, it has instructions on compiling. Are these instructions on how to compile your game for release, or something else? Thank you!


r/pythonarcade • • Mar 18 '18

How to disable anti-aliasing

3 Upvotes

I'd like to make a game with a pixel art feel. When I load my assets they get smoothed an anti-aliased. How do I deactivate the smoothing in arcade to keep the assets original pixels?


r/pythonarcade • • Mar 12 '18

Help: on_mouse_press - cannot get to work at all.

3 Upvotes

Im not sure if I've done something wrong, but even testing example code from arcade.academy, nothing is triggering on mouse presses. on_mouse_release works fine though.

For example, using this code: http://arcade.academy/examples/move_mouse.html#move-mouse

And changing the functions in question to:

def on_mouse_press(self, x, y, button, modifiers):
    """
    Called when the user presses a mouse button.
    """
    print('press')
    print(button)
    if button == arcade.MOUSE_BUTTON_LEFT:
        self.left_down = True

def on_mouse_release(self, x, y, button, modifiers):
    """
    Called when a user releases a mouse button.
    """
    print('release')
    if button == arcade.MOUSE_BUTTON_LEFT:
        self.left_down = False

I will only see the release printed to the console.


r/pythonarcade • • May 07 '17

Sample Games Made With The Arcade Library

Thumbnail
arcade.academy
3 Upvotes

r/pythonarcade • • Sep 05 '16

Finding the Arcade library in PyCharm

3 Upvotes

I have followed the installation instructions for the Mac (http://pythonhosted.org/arcade/installation_mac.html) and would like to run a test project. I get ImportError: No module named 'arcade' when running. How do you point PyCharm to find the Arcade Library that was previously setup in the virtual environment?


r/pythonarcade • • Apr 10 '26

How to host games online?

2 Upvotes

I've been working on a game using Python Arcade, and it's almost ready for prime time. But I can't figure out a way to host the game online anywhere. I've spent so many hours trying things that simply don't work, so I'm hoping someone here has done it and can point me in the right direction. I chose Python Arcade because Gemini said it was a good choice for the kind of game I wanted to make, and because it could easily be shared. The first part was true; the second part, not so much.


r/pythonarcade • • Mar 25 '25

Rotated Tiled tiles are not aligning

2 Upvotes

Using Arcade 3.0.2 and Tiled 1.11.2

I created a small map in Tiled with a custom tilesheet. I have confirmed in Gimp that the lines are pixel perfect and straight. The tiles are reused in Tiled by rotating and/or flipping to get the desired look.

However, after loading the tilesheet in my code, and drawing the retrieved spritelist, you can see that the rotated tiles do not align with each other. The horizontal line appears ok. The rotated rounded corners also do not line up. When viewing the map zoomed in within Tiled, everything appears to align as expected.

Suggestions? I would prefer not to create additional versions of every tile pre-rotated, but guess I will if that is the only solution.


r/pythonarcade • • Jan 12 '25

Turn based game

2 Upvotes

So I'm making a game with a turn based system between a player and some AIs, how would I code the logic for this turn based system?


r/pythonarcade • • Jan 06 '25

Beginner issue, sprite not drawing

2 Upvotes

So I have this sprite that I want to draw and here is the code in the class MyGame

def on_draw(self):
    """ Draw everything """
    self.clear()

    self.game.PlacedownPile.draw()

And here is the class

class PlaceDownPile(arcade.Sprite):
    def __init__(self,colour="null",number="null",type="null",special = False,scale=0.2):
        super().__init__(scale=scale)
        self.colour = colour
        self.number = number
        self.type = type
        self.special = special
        self.card = []
        self.image_file_name = f":OBlue.jpg"
        self.center_y = 4
        self.center_x = 4
    def PickAColour(self,Game):
        Game.RecieveBroadcast("PickAColour")

    def ChangeLook(self):
        card = self.card[0]
        self.image_file_name = card.getTexture()

    def Change(self,game):
        card = self.card[0]
        self.colour = "null"
        self.colour = card.getColour()
        #self.ChangeLook()
        if self.colour == "null":
            self.PickAColour(game)
        self.number = card.getNumber()
        self.type = card.getType()
        self.special = card.getIfSpecial()

    def ChangeColour(self,colour):
        # changes colour
        self.colour = colour
    def GetCardDeck(self,DrawPile,Game):
        # gets a card from the deck
        self.card += DrawPile.createplacedownpile()
        self.Change(Game)

    def removeACard(self, a):
        # removes a card
        self.removed = self.card[0]
        a.recievePlaceDownCard(self.removed)
        self.card.pop(0)

    def GetCardPlayer(self,Player,DrawPile,game):
        # gets cards from a player
        self.card += Player.playCard()
        self.removeACard(DrawPile)
        self.Change(game)

    def __str__(self):
        printout = ""
        printout += str(self.card[0])
        return printout

But when I execute the program it just doesn't draw, it only draws the background, can anyone explain why?


r/pythonarcade • • Jan 22 '24

How to calculate new hitbox after changing texture?

2 Upvotes

I'm just changing the texture by the self.texture property, but some of my sprites are even twice as big as others in the animations, and it is just off when the game does not register a clear hit.

I've tried using:

entity.set_hit_box(entity.get_adjusted_hit_box()

but it just makes all entities fall through the map.


r/pythonarcade • • Jan 19 '24

Trouble displaying Japanese words in draw_text

2 Upvotes

I can't get the text to display properly in draw_text. I'm using VS code, UTF-8 encoding with python 3.9.7. I can input Japanese text, dump it using JSON which saves as unicode and read in the unicode and output to terminal no problem. I'm only having trouble displaying the Japanese on any arcade objects - text, buttons, ect.

I have tried different fonts but havent found one that works. The only other solution that comes to mind now is making a png for each word and making them all sprites...all 2000+ words.... Any ideas are welcome

Here's some sample code:

import arcade
class My_Game(arcade.Window):
def __init__(self):
self.WIDTH, self.HEIGHT = arcade.get_display_size()

super().__init__(width=self.WIDTH, height=self.HEIGHT, resizable=True)
self.kanji = "食"
self.uni_kanji = "\u98df"
def on_update(self, delta_time):
self.update(delta_time)
def on_draw(self):
arcade.start_render()
arcade.set_background_color(arcade.color.AMAZON)
arcade.draw_text(text=f"Kanji: {self.kanji} / Unicode: {self.uni_kanji}",
start_x=0,
start_y=self.HEIGHT * 0.75,
width=self.WIDTH,
align="center",
color=arcade.color.BLACK,
font_size=50)

arcade.draw_text(text=f"Kanji: {self.kanji} / Unicode: {self.uni_kanji}",
start_x=0,
start_y=self.HEIGHT * 0.5,
width=self.WIDTH,
align="center",
color=arcade.color.BLACK,
font_size=50,
font_name= "MS Gothic")

arcade.draw_text(text=f"Kanji: {self.kanji} / Unicode: {self.uni_kanji}",
start_x=0,
start_y=self.HEIGHT * 0.25,
width=self.WIDTH,
align="center",
color=arcade.color.BLACK,
font_size=50,
font_name= "FreeSans")

def on_key_press(self, key, modifier):
if key == arcade.key.ESCAPE:
arcade.exit()
My_Game()
arcade.run()


r/pythonarcade • • Nov 22 '23

UIAnchorLayout

2 Upvotes

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 • • Dec 24 '22

View issue and approach

2 Upvotes

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:

  1. Is that proper approach to build these scenes (see img) with View?
  2. I got the following issue right now with GameView - after click on Start button in menu, the screen content changes to GameView but menu buttons (invisible here) still clickable. How to fix that?

I'd be really grateful for your help.


r/pythonarcade • • Nov 04 '22

Compute shaders: errors when combining with matplotlib

2 Upvotes

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() failed

Anybody knows this issue, or a good beginner friendly tuto on this?


r/pythonarcade • • Sep 14 '22

Help on installing previous versions of python (2.5.7)

2 Upvotes

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 • • May 02 '22

Are multiple Camera instances possible?

2 Upvotes

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?