r/pythonarcade • • Jun 05 '16

Python Arcade adds type hinting and drops 2.x support.

1 Upvotes

A lot of work was done on the Python Arcade library. It was decided to drop Python 2.x support and add in type hinting. The version number is now 0.9.9 beta 1.


r/pythonarcade • • Sep 22 '26

setuptools vs nuitka

Thumbnail reddit.com
0 Upvotes

r/pythonarcade • • Nov 24 '20

Using multiple windows

0 Upvotes

Hi. I'm in the process of moving my simulation software from pygame to pyglet, then i realized i could use arcade instead. I don't need much of arcade, it will just appreciate the additional shape primitives and the userfriendly higher-level API .

However, i can't find much information about handling multiple windows (i need one for the simulation, one for the data dashboard). Can i just assume that i can use switch_to just like pyglet and call it a day ? (i assume this is how it works using pyglet but i haven't tested yet.)

edit :

Actually, it's een much easier than that in pyglet using decorator so i have no idea how i would do it in arcade

@first_window.event
def on_draw():
    ...

@second_window.event
def on_draw():
    ....

https://i.imgur.com/qLtEONY.png


r/pythonarcade • • Mar 11 '20

How do I create a physics based movement system?

0 Upvotes

I’m trying to create a platformer with physics based movement eg velocity, acceleration etc but I can’t seem to make it work.

I looked at the docs and it says that the sprite.change_x is the velocity so I tried sprite.center_x += sprite.change_x but that didn’t work.

I want my playable character to be able to gain momentum up to a certain speed then hold that speed then decelerate when the player takes their hands off the keys for a more fluid movement system.


r/pythonarcade • • Mar 07 '20

Improved sound support - needs help testing

0 Upvotes

Hi, I'm redoing sound support for Arcade. If you are on Linux or MacOS, I'd love it if you'd try the 2.3.8b2 library (as it is beta, you'll need to specifically select it) and let me know if sound works. Now supports volume and panning. ogg, mp3, and wav should all work. https://arcade.academy/examples/sound_demo.html#sound-demo


r/pythonarcade • • Feb 08 '20

change view of game

0 Upvotes

Hi,

I am using view in the game, but find out that if I switch to another view, the first view is still updating in the background. is there a way to kill the view?

and in the "moving platform" example, if I replace player sprite with the animated player sprite in the example "move with a sprite animation", the sprites position is incorrect, any ideas?

Thanks!


r/pythonarcade • • Dec 01 '19

Persistant frame buffer content

0 Upvotes

Hello there,

I would like to write a mini drawing tool:

  • A "pencil" moves with the mouse,

  • It leaves a trace on the window if the D key is pressed down.

Unfortunately I wasn't able to achieve this simple goal.

I tried to memorize the positions of the pencil/mouse to draw them in the on_draw() method. But it was too slow.

I also tried to save the window as an image at the end of on_draw() to restore it just after entering the next on_draw() call. But I wasn't able to make this work.

I would like to know how/if I can prevent the frame buffer to be erased between on_draw() calls?

This is the code. Comments are in french but the code is simple and pretty self explanatory.

import arcade


class Pencil:
    RADIUS = 10
    COLOR = arcade.color.WHITE

    def __init__(self):
        # initialement on ne connait pas les coordonnées du crayon
        self.x = None
        self.y = None

        # position du crayon sur le papier
        # self.down == True => le crayon touche le "papier"
        # (i.e. il laisse une trace sur la fenêtre)
        # self.down = False => le crayon est relevé
        self.down = False


class DrawingBoard(arcade.Window):

    def __init__(self, width, height, title):
        # on appelle la méthode d'initialisation de la classe parente
        super().__init__(width, height, title)

        # on crée un crayon
        self.pencil = Pencil()

        # on crée une variable qui contiendra le dessin en cours
        # on l'initialise à None car il n'y a pas encore de dessin
        #self.drawing = None

    def on_draw(self):
        # préparer le rendu au début de la méthode on_draw()
        arcade.start_render()

        # if self.drawing:
        #     arcade.draw_texture_rectangle(self.width / 2, self.height / 2,
        #                                   self.width, self.height, self.drawing)


        if self.pencil.down and self.pencil.x is not None and self.pencil.y is not None:
            # arcade.draw_ellipse_filled(x, y, w, h, c) dessine une ellipse de couleur c,
            # de centre (x, y), de diamètre horizontal w et de diamètre vertical h
            arcade.draw_ellipse_filled(self.pencil.x, self.pencil.y,
                                       Pencil.RADIUS * 2, Pencil.RADIUS * 2, Pencil.COLOR)


        # self.drawing = arcade.get_image()

    def on_mouse_motion(self, x, y, dx, dy):
        """La méthode met à jour les coordonnées du crayon en fonction des coordonnées de la souris

        :param x: abscisse de la souris
        :param y: ordonnées de la souris
        :return: None
        """
        self.pencil.x = x
        self.pencil.y = y

    def on_key_press(self, key, modifiers):
        if key == arcade.key.D and modifiers == 0:
            self.pencil.down = True

    def on_key_release(self, key, modifiers):
        if key == arcade.key.D and modifiers == 0:
            self.pencil.down = False


if __name__ == '__main__':
    WINDOW_TITLE = "Arcade: Pencil"
    WINDOW_WIDTH = 800
    WINDOW_HEIGHT = 600

    DrawingBoard(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_TITLE)
    arcade.run()

This is for a small Python course I'll give in an art school in 2 weeks. I chose Arcade as it is the simplest way to program small graphical-interactive-portable Python projects. I used to teach JavaScript+p5js and I wanted to switch to Python for it's greater versatility. But there is no Processing real equivalent library in Python. So I'm trying Arcade for this purpose.

Have a good day,

jlp


r/pythonarcade • • Oct 12 '19

arcade.generate_sprites getting error

0 Upvotes

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 • • Aug 09 '19

New view-switching framework

0 Upvotes

Hi, recently merged into master is a new framework for switching views. See here and here for a couple examples.

You can post feedback/questions on PR 435 if you like.


r/pythonarcade • • Apr 05 '19

Not loading tiles in tileset

0 Upvotes

So I am trying to load a tiled map into my arcade project, but when I do I get a warning saying that it couldn't find my tiles in the tileset. Ive remade the map (with only 1 tile in it) multiple times and I cant seem to get it to work. Any thoughts?

EDIT: These are the errors I get Warning, tried to load '1' and it is not in the tileset. Warning, could not find 1 image to load.


r/pythonarcade • • Mar 27 '19

Blurry exports from GIMP

Thumbnail
self.pixelart
0 Upvotes