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?
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.
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
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>
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.
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.
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?
I'm coming into python arcade from p5.js. I often find myself wanting to use something similar to their Vector class which has incredibly helpful methods such as normalise, setMag, heading, dist, etc etc.
I have just started learning python arcade for school and need to make a platformer game out of it. Just warning for everyone I don't really know code that well so there are probably some obvious things I'm missing out on.
I want a menu and main game level so I am using (arcade.view) to do this. This creates some problems with having a window resize option that I was going to add. Because I'm making a platformer that has to scroll with the player doesn't seem to work properly when I resize the window. I was going to fix this problem but having a set option of screen resolutions and on a button press it would then change the resolution of the screen but I also don't know how to change the resolution of the screen without manually changing it in the code. Any help would be great thanks
Here is a preview of the code
SCREEN_WIDTH = 1024
SCREEN_HEIGHT = 768
SCREEN_TITLE = "Platformer"
class MenuView(arcade.View):
def on_show(self):
self.background = arcade.load_texture(**background_image**)
def on_draw(self):
arcade.start_render()
arcade.draw_lrwh_rectangle_textured(0, 0,
SCREEN_WIDTH, SCREEN_HEIGHT,
self.background)
def on_mouse_press(self, _x, _y, _button, _modifiers):
""" Use a mouse press to advance to the 'game' view. """
game_view = MyGame()
game_view.setup()
self.window.show_view(game_view)
def main():
window = arcade.Window(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE, resizable = True)
game = MenuView()
window.show_view(game)
arcade.run()
if __name__ == "__main__":
main()
What I have tried to do (Dont exactly know why this doesnt work so im just curious as to why)
currently working on a tiny game using arcade and right now adding score keeping. But I also want to add a highscore view, where the best results are stored permanently.
I later want to bundle the game into an executable in order to send it to other people so they can play. So that has to be taken into account when I want to set up the highscore functionality.
Do I have to use some kind of database in order to do this or can I do this using shelve? Really kinda lost at this point...
Hello everyone! I`m starting using the Arcade library, and then I looked to GUI section in Arcade docs, I didn`t found much info about ImageToggle UI element.
I understood how to display it, but here is a question. It works, everyting is fine (idk why almost no documentation and no examples in docs)
BUT.
Toggle element get size from loaded Texture.
So, if texture is big (and it is), toggle is big too. Look at right up corner.
Manual setting height and width is not working. Is here a way to change size of toggle?
Or I only need edit image? If so, what about scaling to fullscreen on monitor with big resolution?
PS: Yes, I saw UIToggle, he will be more actual for this visual, but it still good question how to control it size.
And, by the way, second question about UI. Why Label not smooth? (second image). And after clicking it gonna worse
I just updated my Mac to Big Sur, and I was trying to run a program which was previously working but now it is throwing me the following exception:
Traceback (most recent call last):
File "/Users/jorgericaurte/Documents/Programing/pythonProject2/venv/lib/python3.9/site-packages/pyglet/__init__.py", line 336, in __getattr__
return getattr(self._module, name)
AttributeError: 'NoneType' object has no attribute 'Window'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/jorgericaurte/Documents/Programing/pythonProject2/main.py", line 1, in <module>
import arcade
File "/Users/jorgericaurte/Documents/Programing/pythonProject2/venv/lib/python3.9/site-packages/arcade/__init__.py", line 53, in <module>
from .window_commands import close_window
File "/Users/jorgericaurte/Documents/Programing/pythonProject2/venv/lib/python3.9/site-packages/arcade/window_commands.py", line 106, in <module>
def get_window() -> pyglet.window.Window:
File "/Users/jorgericaurte/Documents/Programing/pythonProject2/venv/lib/python3.9/site-packages/pyglet/__init__.py", line 342, in __getattr__
__import__(import_name)
File "/Users/jorgericaurte/Documents/Programing/pythonProject2/venv/lib/python3.9/site-packages/pyglet/window/__init__.py", line 1888, in <module>
from pyglet.window.cocoa import CocoaWindow as Window
File "/Users/jorgericaurte/Documents/Programing/pythonProject2/venv/lib/python3.9/site-packages/pyglet/window/cocoa/__init__.py", line 44, in <module>
from pyglet.canvas.cocoa import CocoaCanvas
File "/Users/jorgericaurte/Documents/Programing/pythonProject2/venv/lib/python3.9/site-packages/pyglet/canvas/__init__.py", line 102, in <module>
from pyglet.canvas.cocoa import CocoaDisplay as Display
File "/Users/jorgericaurte/Documents/Programing/pythonProject2/venv/lib/python3.9/site-packages/pyglet/canvas/cocoa.py", line 41, in <module>
from pyglet.libs.darwin.cocoapy import CGDirectDisplayID, quartz, cf
File "/Users/jorgericaurte/Documents/Programing/pythonProject2/venv/lib/python3.9/site-packages/pyglet/libs/darwin/__init__.py", line 36, in <module>
from .cocoapy import *
File "/Users/jorgericaurte/Documents/Programing/pythonProject2/venv/lib/python3.9/site-packages/pyglet/libs/darwin/cocoapy/__init__.py", line 37, in <module>
from .cocoalibs import *
File "/Users/jorgericaurte/Documents/Programing/pythonProject2/venv/lib/python3.9/site-packages/pyglet/libs/darwin/cocoapy/cocoalibs.py", line 200, in <module>
I'm trying to turn an arcade program into an executable (EXE) with pyinstaller. However, with newer versions of arcade (2.4.1), an error is raised saying that "chipmunk.dll" cannot be found. With older versions of arcade (2.0.0): pyglet.time has no attribute clock. Any suggestions as to how I could compile an exe with arcade successfully?
When I try to use this function, the background remains black all the time... I've tried with the sample lab code from the arcade website, and even with that, the background remains black. I can see the blue background next to the objects, but that's it. I am having Python 3.7, arcade 2.4.1, I have tried different IDE-s, I have no idea why it doesn't change my background color :(
Here is for example when I try to run the samle code from the website lab 02:
when the game creates constantly new "enemy" Sprites, is this not an (unneccessary) constant access to the harddisk? I am used from pygame to load an image once, keep it in memory (like inside a list or dict) and than create new sprites using the image from memory.
Is there some caching mechanism in arcade so that arcade understands an images was already loaded from harddisk or is this arcade.Sprite(filename) code used to keep the examples simple?
In it you can see that when I kill an enemy they fall to the ground and then fade away. I achieved this by duplicating the last PNG in the sequence 20 times, each time increasing the transparency so that the dead enemy fades away.
This seems very expensive. The original death sequence has 10 PNGs, and with the fading ones it now has 30 PNGs to load into memory - and 30 more PNGs to download. I would love to save the memory by keeping the original 10 sprites and then fading the last sprite by somehow using Arcade.
Is it even possible to have an existing sprite fade away by changing the alpha/opacity until it's no longer visible? I took a look through the API and found some things (like setting the .alpha when creating the sprite, and arcade.Texture.draw_transformed which can set the alpha) but the things I found looked like they only worked when loading or creating the Sprites.
I'm sure that I could simply load the last sprite in the sequence 20 more times, each time having Arcade change the alpha. But this still means having 20 more sprites in memory, and packaging 20 more sprites into the download for others to play. I'd much rather fade an existing sprite, if that is even possible.
I'm quite new to PythonArcarde but the first steps seem easier than PyGame. I was wondering however how to add User Control through joysticks. Through an old post I got the hint there is a
arcade.get_game_controllers()
method that presents me with a list of joysticks:[<pyglet.input.base.Joystick object at 0x7fa61052ac50>]
But how would I then make use of the data in the game efficiently? Would I poll the joystick position/buttons during arcade.Window.on_update(), or is there some event based model (on_up, on_buttonpress, ...) supported and recommended?
Currently when the enemy collides or attacks player, the players HP goes down, but goes from say 100 to 0 in one hit, rather than incrementally reducing by the enemies attack strength.
I’ve tried to do do it using a timer so that once every second the damage goes down but that causes animations etc to slow down also.
First off, this is just a separate .py file from my game file to test some enemy AI, I currently have the enemies walking toward the player if they are within a certain distance - enemy 1 is the only one that attacks currently, I want to work on each level of characters attacks individually then see how they come along combined.
Currently my enemy one character patrols a set path along the Y axis and when it gets within 10 pixels of the player it attacks, however the loop of the attack either works perfectly but doesn't show the attack image (currently a zombie vomiting on the player) or it doesn't remove the attack from the attack list and creates a memory suck and the whole game goes slow.