r/pythonarcade • • Mar 29 '20

First game, please give feedback both good and bad

7 Upvotes

Here's the youtube link to a quick play-through, still some bugs to sort.

https://youtu.be/dhYoQTYn_Z0


r/pythonarcade • • Mar 11 '20

Demo of what I've started

8 Upvotes

This is a simple 1-minute video of the game I'm working on for the last 2 weeks. Though half that time was spent editing graphics, which is a lot more work than I expected.

Kudos to u/pvc and the Arcade library and his tutorials - particularly https://github.com/pvcraven/arcade/blob/master/arcade/examples/platform_tutorial/11_animate_character.py which I used as the base for the game. Also a big thanks to Attila Toth and his tutorial videos on YouTube (https://www.youtube.com/playlist?list=PL1P11yPQAo7pPlDlFEaL3IUbcWnnPcALI)

Anyway, the game needs a LOT of work, but I think I've finally got it to the point where I can work on all the different animations of the main character, then start on the much-easier enemies. BTW, most of the graphics here came from http://pzuh.blogspot.com/p/downloads.html - great stuff.

https://www.youtube.com/watch?v=la4mvHmY-5o


r/pythonarcade • • Mar 23 '20

Looking for help with a finite state machine

1 Upvotes

I'm new to the whole state machine but found a python video on youtube, how do I develop this to work with the arcade library?

I've tried putting the arcade.Sprite code into the Entity class but unsure how to do it.

Here's what I've got so far: from enum import Enum, auto import arcade

class States(Enum): idle = auto() chase = auto() patrol = auto() attack = auto() death = auto()

class GameObject: def init(self): self.__state = States.idle

def set_state(self, state):
    self.__state = state

def get_state(self):
    return self.__state

class Entity(GameObject): def init(self): super().init() self.player = arcade.Sprite() self.__health = 100 #self.entity = arcade.Sprite()

def move_right(self):
    self.change_x = 2

def assets(self):
    self.__entity = arcade.Sprite("images/green.png")

def load(self, entity):
    self.__entity = entity

def sub_health(self):
    self.__health -= 20

def set_health(self, health):
    self.__health = health

import arcade

SCREEN_WIDTH = 800 SCREEN_HEIGHT = 600 SCREEN_TITLE = "Starting Template"

class MyGame(arcade.Window): """ Main application class.

NOTE: Go ahead and delete the methods you don't need.
If you do need a method, delete the 'pass' and replace it
with your own code. Don't leave 'pass' in this program.
"""

def __init__(self, width, height, title):
    super().__init__(width, height, title)
    self.player = None
    self.player_list = None
    arcade.set_background_color(arcade.color.AMAZON)

    # If you have sprite lists, you should create them here,
    # and set them to None

def setup(self):
    # Create your sprites and sprite lists here

    self.player = Entity()
    self.player.move_right()
    self.player_list = arcade.SpriteList()
    self.player_list.append(self.player)

def on_draw(self):
    """
    Render the screen.
    """

    # This command should happen before we start drawing. It will clear
    # the screen to the background color, and erase what we drew last frame.
    arcade.start_render()
    self.player_list.draw()
    # Call draw() on all your sprite lists below

def on_update(self, delta_time):
    """
    All the logic to move, and the game logic goes here.
    Normally, you'll call update() on the sprite lists that
    need it.
    """
    self.player_list.update()

def on_key_press(self, key, key_modifiers):
    """
    Called whenever a key on the keyboard is pressed.

    For a full list of keys, see:
    http://arcade.academy/arcade.key.html
    """
    pass

def on_key_release(self, key, key_modifiers):
    """
    Called whenever the user lets off a previously pressed key.
    """
    pass

def on_mouse_motion(self, x, y, delta_x, delta_y):
    """
    Called whenever the mouse moves.
    """
    pass

def on_mouse_press(self, x, y, button, key_modifiers):
    """
    Called when the user presses a mouse button.
    """
    pass

def on_mouse_release(self, x, y, button, key_modifiers):
    """
    Called when a user releases a mouse button.
    """
    pass

def main(): """ Main method """ game = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE) game.setup() arcade.run()

if name == "main": main()


r/pythonarcade • • Mar 16 '20

How do I keep players health bar x and y constant?

2 Upvotes

I have my players health bar (drawn to the screen) to the value of the players health eg

Self.player_health_bar.width = self.player.health

But when the health decreases it decreases from both sides and loses its left most positioning and pulls away from the rest of the HUD.

Currently I’m positioning the center_x and center_y to the viewport so it moves with the screen.

I tried setting the left to see if that would hold the left most position but that didn’t work.

Any suggestions?


r/pythonarcade • • Apr 03 '20

Converting a Pygame app - got some questions

4 Upvotes

Hi folks

As a way to teach myself Python I decided to write a robot battle / robot finding its way through a maze app. My background BTW is commercial coding - so wanted to do something completely different! LOL

So - decided needed to use sprites, wrote my own game physics stuff for rotation and navigation code and used Pygame.

Now that I've got to the point where I'm going to start to code the intelligence into the avatars instead of random movement and the 'arena' stopping them from going off the edge and collision detection.

Pygame is OK but when it's rotating my sprites the circles are losing shape so ragged edge - the collision detection is slow so I put in KDTree checking for most of it and them Pygame mask checks for the rest and I've got things like a world map based on what the robot has 'seen' overlaying the game space.

I've looked at Arcade in a hope that it's better for graphics being based on Pyglet so it takes advantage of better handling etc.

What I can't seem to work out is in Pygame I create a surface and draw onto that to have as the image for a sprite - how does Arcade do this? (The robot's world map is a sprite that is shown if the avatar is mouse clicked)

In a debug mode I show the scan areas that the avatar uses and I create these shapes and not load them because they are dynamically sized.

I think porting now to Arcade is a good move - gets my Python learning a direction change which can only be good plus the smoother graphics look appealing (I wrote a spike to use Arcade with my avatars and the rotation / movement looked a lot better)

So any help / pointers would be useful - in the meantime I'll look to knock up some spikes to see what I can fathom out

For reference I've added a screen shot of the app at present - as you will see the avatar edges aren't round anymore sure to rotation transformations.

TIA

RC


r/pythonarcade • • Mar 03 '20

Need help with enemy ai - attack when player gets close

3 Upvotes

So far I’ve got a function from the the arcade tutorials that gets the the enemy to follow the player around the screen attacking him but I’d like for the enemy to patrol a certain area and only attack when the player gets within a certain radius.

I’ve tried using:

If enemy.center_x - player.center_x < 50:

Move the enemy

Here’s the function maybe there’s something I’m overlooking

def follow_sprite(self, player_sprite): """ This function will move the current sprite towards whatever other sprite is specified as a parameter.

We use the 'min' function here to get the sprite to line up with
the target sprite, and not jump around if the sprite is not off
an exact multiple of SPRITE_SPEED.
"""

self.center_x += self.change_x
self.center_y += self.change_y

# Random 1 in 100 chance that we'll change from our old direction and
# then re-aim toward the player
if random.randrange(100) == 0:
    start_x = self.center_x
    start_y = self.center_y

    # Get the destination location for the bullet
    dest_x = player_sprite.center_x
    dest_y = player_sprite.center_y

    # Do math to calculate how to get the bullet to the destination.
    # Calculation the angle in radians between the start points
    # and end points. This is the angle the bullet will travel.
    x_diff = dest_x - start_x
    y_diff = dest_y - start_y
    angle = math.atan2(y_diff, x_diff)

    # Taking into account the angle, calculate our change_x
    # and change_y. Velocity is how fast the bullet travels.
    self.change_x = math.cos(angle) * COIN_SPEED
    self.change_y = math.sin(angle) * COIN_SPEED

r/pythonarcade • • Mar 21 '20

How do I go about taking x damage from enemy to player when attack happens

3 Upvotes

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.


r/pythonarcade • • Mar 18 '20

Developing enemy AI, game seems to have a memory leak somewhere but can't find where, any help?

3 Upvotes

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.

Here's my code:

import arcade

class Enemy(arcade.Sprite):

#def __init__(self, hp, attack, defence, type, texture):
#    super().__init__()
#    self.hp = hp
#    self.attack = attack
#    self.defence = defence
#    self.type = type
#    self.texture = texture

class Window(arcade.Window): def init(self): super().init(600, 600, 'move') self.sprite_list = None self.enemy_attack_list = None

    self.enemy1 = None
    self.enemy1_hp = 10
    self.enemy1_power = 10
    self.enemy1_is_attacking = False
    self.enemy1_attack = None
    self.enemy1_health_bar = None

    self.enemy2 = None
    self.enemy2_hp = 20
    self.enemy2_power = 20
    self.enemy2_is_attacking = False
    self.enemy2_health_bar = None

    self.enemy3 = None
    self.enemy3_hp = 30
    self.enemy3_power = 30
    self.enemy3_is_attacking = False
    self.enemy3_health_bar = None

    self.player = None
    self.player_hp = 10
    self.player_list = None
    self.player_health_bar = None

    self.health_list = None

    self.frame_count = 0

def setup(self):
    self.sprite_list = arcade.SpriteList()
    self.player_list = arcade.SpriteList()
    self.health_list = arcade.SpriteList()
    self.enemy_attack_list = arcade.SpriteList()

    self.player = arcade.Sprite("images/pl1.png", 2)
    self.player.position = (50, 50)
    self.player_health_bar = arcade.Sprite("images/p_health.png")
    self.player_health_bar.position = (100, 500)
    self.player_health_bar.width = self.player_hp
    self.player_list.append(self.player)

    self.enemy1 = arcade.Sprite("images/sewer_monster.png", 2)
    self.enemy1.position = (100, 100)
    self.enemy1.boundary_left = 100
    self.enemy1.boundary_right = 400
    self.enemy1_health_bar = arcade.Sprite("images/e_health.png")
    self.enemy1_health_bar.position = (100, 500)
    self.enemy1_health_bar.width = self.enemy1_hp
    self.sprite_list.append(self.enemy1)

    self.enemy1_attack = arcade.Sprite("images/zombie_vomit.png", 4)
    self.enemy1_attack.center_x = self.enemy1.center_x
    self.enemy1_attack.center_y = self.enemy1.center_y
    #self.enemy_attack_list.append(self.enemy1_attack)

    self.enemy2 = arcade.Sprite("images/em2.png", 3)
    self.enemy2.position = (200, 200)
    self.enemy2_health_bar = arcade.Sprite("images/e_health.png")
    self.enemy2_health_bar.position = (250, 500)
    self.enemy2_health_bar.width = self.enemy2_hp
    self.sprite_list.append(self.enemy2)

    self.enemy3 = arcade.Sprite("images/em3.png", 3)
    self.enemy3.position = (300, 300)
    self.enemy3_health_bar = arcade.Sprite("images/e_health.png")
    self.enemy3_health_bar.position = (200, 500)
    self.enemy2_health_bar.width = self.enemy3_hp
    self.sprite_list.append(self.enemy3)

    self.health_list.append(self.enemy1_health_bar)
    self.health_list.append(self.enemy2_health_bar)
    self.health_list.append(self.enemy3_health_bar)
    self.health_list.append(self.player_health_bar)

def on_key_press(self, key, modifiers):
    if key == arcade.key.RIGHT:
        self.player.change_x = 2
    elif key == arcade.key.LEFT:
        self.player.change_x = -2
    elif key == arcade.key.UP:
        self.player.change_y = 2
    elif key == arcade.key.DOWN:
        self.player.change_y = -2
    elif key == arcade.key.A:
        self.enemy1_is_attacking = True
        self.enemy_attack_list.append(self.enemy1_attack)

def on_key_release(self, key, modifiers):
    if key == arcade.key.RIGHT:
        self.player.change_x = 0
    elif key == arcade.key.LEFT:
        self.player.change_x = 0
    elif key == arcade.key.UP:
        self.player.change_y = 0
    elif key == arcade.key.DOWN:
        self.player.change_y = 0


def on_draw(self):
    arcade.start_render()
    self.sprite_list.draw()
    self.player_list.draw()


    ph = f"P: {self.player_hp}"
    e1 = f"E1: {self.enemy1_hp}"
    e2 = f"E2: {self.enemy2_hp}"
    e3 = f"E3: {self.enemy3_hp}"

    atkX = f"Enemy attack X: {self.enemy1_attack.center_x}"
    atkY = f"Enemy attack Y: {self.enemy1_attack.center_y}"
    enX = f"Enemy1 X: {self.enemy1.center_x}"
    enY = f"Enemy1 Y: {self.enemy1.center_y}"
    eB = f"Enemy Bottom: {self.enemy1.bottom}"
    aB = f"Attack Bottom: {self.enemy1_attack.bottom}"

    is_attacking = f"Enemy is attacking: {self.enemy1_is_attacking}"

    arcade.draw_text(ph, 100, 400, arcade.csscolor.RED, 16)
    arcade.draw_text(e1, 100, 380, arcade.csscolor.ORANGE, 16)
    arcade.draw_text(e2, 100, 360, arcade.csscolor.ORANGE, 16)
    arcade.draw_text(e3, 100, 340, arcade.csscolor.ORANGE, 16)

    arcade.draw_text(atkX, 200, 200, arcade.csscolor.CORNFLOWER_BLUE, 16)
    arcade.draw_text(atkY, 200, 180, arcade.csscolor.CORNFLOWER_BLUE, 16)
    arcade.draw_text(enX, 200, 160, arcade.csscolor.CORNFLOWER_BLUE, 16)
    arcade.draw_text(enY, 200, 140, arcade.csscolor.CORNFLOWER_BLUE, 16)
    arcade.draw_text(eB, 200, 120, arcade.csscolor.CORNFLOWER_BLUE, 16)
    arcade.draw_text(aB, 200, 100, arcade.csscolor.CORNFLOWER_BLUE, 16)

    arcade.draw_text(is_attacking, 200, 80, arcade.csscolor.CADET_BLUE)

    if self.enemy1_is_attacking:
        self.enemy_attack_list.draw()


def on_update(self, delta_time):
    self.frame_count += 1

    if not self.enemy1_is_attacking:
        #self.enemy1.change_x *= 2
        self.enemy1_is_attacking = False
        if self.enemy1.center_x >= self.enemy1.boundary_right:
            self.enemy1.change_x = -2
        elif self.enemy1.center_x <= self.enemy1.boundary_left:
            self.enemy1.change_x = 2
        elif self.enemy1.change_x == 0:
            self.enemy1.change_x = 2
        for attack in self.enemy_attack_list:
                attack.remove_from_sprite_lists()


    elif self.enemy1_is_attacking:
            z_attack = arcade.Sprite("images/zombie_vomit.png", 3)
            z_attack.center_x = self.enemy1.center_x - 28
            z_attack.center_y = self.enemy1.center_y
            self.enemy_attack_list.append(z_attack)
            if self.frame_count % 60 == 0:
                z_attack.change_y = -1
                #self.enemy1_attack.change_x = -1
                #if arcade.get_distance_between_sprites(self.enemy1, self.enemy1_attack) > 15:
                #    self.enemy1_attack.change_x = 0
                #    self.enemy1_attack.change_y = 0
                #self.enemy_attack_list.append(self.enemy1_attack)
    for attack in self.enemy_attack_list:

            if arcade.check_for_collision_with_list(self.player, self.enemy_attack_list):
                if self.frame_count % 60 == 0:
                    self.player_hp -= 1
                #self.player.center_x -= 2
                attack.remove_from_sprite_lists()
            if attack.bottom == self.enemy1.bottom:
                attack.remove_from_sprite_lists()

                #attack.change_y = 0
                #attack.center_x = self.enemy1.center_x - 28
                #self.enemy1_attack.center_x = self.enemy1.center_x - self.enemy1.width - 4
                self.enemy1_is_attacking = False


            
    for enemy in self.sprite_list:
        if arcade.get_distance_between_sprites(self.player, enemy) < 100:
            # If the player is on our right
            if enemy.left < self.player.left:
                if arcade.get_distance_between_sprites(self.player, enemy) < 50:
                    enemy.change_x = 0
                    self.enemy1_is_attacking = True
                else:
                    enemy.change_x = 2
                    self.enemy1_is_attacking = False
                    if enemy.center_x == 0:
                        enemy.change_x = 0
            # If player is on our left
            elif enemy.left > self.player.left:
                if arcade.get_distance_between_sprites(self.player, enemy) < 50:
                    enemy.change_x = 0
                    self.enemy1_is_attacking = True
                else:
                    enemy.change_x = -2
                    self.enemy1_is_attacking = False
                    if enemy.center_x == 600:
                        enemy.change_x = 0
            elif enemy.left == self.player.left:
                self.enemy1_is_attacking = True
                enemy.change_x = 0

        if arcade.check_for_collision_with_list(enemy, self.player_list):
            if enemy.left < self.player.left:
                enemy.center_x = self.player.center_x + 40
                enemy.change_x = 0
                self.player_hp -= 1
                self.enemy1_is_attacking = True
            if enemy.left > self.player.left:
                enemy.center_x = self.player.center_x - 40
                enemy.change_x = 0
                self.player_hp -= 1
                self.enemy1_is_attacking = True
            else:
                self.enemy1_is_attacking = False
            #self.enemy1.center_x = self.player.center_x - 32
    self.sprite_list.update()
    self.player_list.update()
    self.health_list.update()
    self.enemy_attack_list.update()

def main(): window = Window() window.setup() arcade.run()

if name == "main": main()


r/pythonarcade • • Mar 27 '20

Python Discord Game Jam with the Arcade Library

Thumbnail pythondiscord.com
4 Upvotes

r/pythonarcade • • Mar 22 '20

Update for Hated Space, the game I have been making using Arcade!

7 Upvotes

Firstly, big thanks to u/pvc raven and the whole Arcade team! The constant improvements to the engine have been awesome :)

So, I am working on a pixel art roguelite / space exploration game, called Hated Space. You can find updates at https://humanshs.itch.io/hatedspace or https://twitter.com/humansHS . I learned Python for use for my mechanical engineering jobs and studies. I find the language to be easy to use and the extensive libraries/modules (like Arcade) give you huge versatility.

Since I last posted a month ago, I been able to add lots of fun features. Most classes inherit from the Arcade Sprite class: Interactable, Mob, Player, Bullet and Effect:

/img/36bt1eauc8o41.gif

I rely heavily on Python dictionaries and a CSV reader to be able to store and lookup all important information:

Storing it in CSV files makes editing, stat comparisons and lookups much easier:

Anyway, that is the main things I think are worth sharing. I will continue to work on the game and give monthly updates. I am HOPING to have a demo ready some time between late June and early August (depending on my other workloads and progress!).

Thanks for reading,

humans.


r/pythonarcade • • Mar 27 '20

How to integrate joystick support into Arcade game?

3 Upvotes

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?

Without any better response I guess I'd simply follow the pyglet documentationhttps://pyglet.readthedocs.io/en/latest/programming_guide/input.html#using-joysticks


r/pythonarcade • • Apr 03 '20

Blank screen after I run code once

1 Upvotes

I just installed arcade yesterday but I am able to run the example codes only once. If I try run the code again in brings a blank screen and it won't show anything till I restart my system. Is there a way to fix this.

I am using MX Linux (debian buster) and I run my code through the terminal.


r/pythonarcade • • Mar 27 '20

Example code for playing background music

Thumbnail
arcade.academy
4 Upvotes

r/pythonarcade • • Mar 25 '20

arcade 2.3.9 is out

Thumbnail
arcade.academy
4 Upvotes

r/pythonarcade • • Sep 15 '21

Is anyone developing with Arcade on WSL2?

2 Upvotes

Does anyone here develop with Arcade on Windows Subsystem for Linux (WSL2)? If so, I'm curious to see how you've set up your development environment, particularly with OpenGL + WSL2.


r/pythonarcade • • Aug 18 '21

Finished programming and distributing new game, Bouncedown 2, all in arcade

10 Upvotes

Hey all, super happy to announce that I have fully finished a game and distributed it through itch.io. The name of the game is Bouncedown 2, and it's available to play as a download for Windows and OSX. Make sure you are on OSX 10.14+.

The game is available for free on itch.io

Download at itch.io: https://spaderdabomb.itch.io/bouncedown-2

To get involved and help improve Bouncedown join

Discord: https://discord.gg/8dKCtaQsa5

Bouncedown 2 Features

  • Remastered graphics in Ultra HD

  • Online highscores

  • 24 achievements (some very difficult!)

I've been programming games as a hobby on and off over the years. It's notoriously difficult to finish a game all the way through completion. Really happy to finally get one through the pipeline and get a release out, no less using Python arcade.


r/pythonarcade • • Aug 25 '21

How to add parameters to arcade.schedule functions

2 Upvotes

How do i pass a function with parameters into the arcade.schedule method?


r/pythonarcade • • Aug 12 '21

Arcade 2.6.0.dev5 pre-release is out

2 Upvotes

Arcade 2.6.0.dev5 is out as a pre-release. (You'll have to specify the version when pip-installing, or you'll get 2.5.7.) If you want to try out the new (or old) features, we'd love your feedback. Release notes: https://api.arcade.academy/en/development/development/release_notes.html


r/pythonarcade • • Aug 30 '21

The Python 2D game library Arcade 2.6.0 has been released

13 Upvotes

For full release notes (with pictures!), see the Arcade 2.6.0 release notes.

Version 2.6.0

Released on 2021-Aug-30

Version 2.6.0 is a major update to Arcade. It is not 100% backwards compatible with the 2.5 API. Updates were made to text rendering, tiled map support, sprites, shaders, textures, GUI system, and the documentation.

  • Tiled Map Editor support has been overhauled.

    • Arcade now uses the .json file format for maps created by the Tiled Map Editor rather than the TMX format. Tile sets and other supporting files need to all be saved in .json format. The XML based formats are no longer supported by Arcade.

    • Arcade now supports a minimum version of Tiled 1.5. Maps saved with an older version of Tiled will likely work in most scenarios, but for all features the minimum version we can support is 1.5 due to changes in the Tiled map format.

    • Feature-support for Tiled maps has been improved to have near 100% parity with Tiled itself.

    • See :ref:platformer_tutorial for a how-to, Tiled usage starts at Chapter 9.

    • See Community RPG or Community Platformer for a more complex example program.

    Screenshot of tile map

  • Texture atlases have been introduced, texture management has been improved.

    • A sprite list will create and use its own texture atlas.

    • This introduces a new arcade.TextureAtlas class that is used internally by SpriteList.

    • Sprites with new textures can be added to a sprite list without the delay. Arcade 2.5 had a delay caused by rebuilding its internal sprite sheet.

    • As a side effect, sprites can only belong to one sprite list that renders.

    • The texture atlas portion of a sprite can be drawn to, and quickly updated on the GPU side.

      • To demonstrate, there is a new :ref:minimap example that creates a sprite that has a dynamic minimap projected onto it.

      Screenshot of minimap

  • Revamped text rendering done by arcade.draw_text. Rather than use Pillow to render onto an image, Arcade uses Pyglet's text drawing system. Text drawing is faster, higher resolution, and not prone to memory leaks. Fonts are now specifed by the font name, rather than the file name of the font.

    • Fonts can be dynamically loaded with :func:arcade.load_font.

    • Kenney.nl's TTF are now included as build-in resources.

    • See the drawing_text example.

    Screenshot of drawing text

  • SpriteList optimizations.

    • Sprites now draw even faster than before. On an Intel i7 with nVidia 980 Ti graphics card, 8,000+ moving sprites can be drawn while maintaining 60 FPS. The same machine can only do 2,000 sprites with Pygame before FPS drops.

  • Shadertoy support.

    • Shadertoy.com <https://www.shadertoy.com/>_ is a website that makes it easier to write OpenGL shaders.

    • The new :class:arcade.Shadertoy class makes it easy to run and interact with these shaders in Arcade.

    • See :ref:shader_toy_tutorial and Asteroids <https://github.com/pythonarcade/asteroids>_.

      Cyber Fuji

      Star Nest

  • Reworked GUI

    Flat buttons

    GUI Widgets

    Message Box

    • UIElements are replaced by UIWidgets

    • Option to relative pin widgets on screen to center or border (supports resizing)

    • Widgets can be placed on top of each other

    • Overlapping widgets properly handle mouse interaction

    • Fully typed event classes

    • Events contain source widget

    • ScrollableText widgets (more to come)

    • Support for Sprites within Widgets

    • Declarative coding style for borders and padding widget.with_border(...)

    • Automatically place widgets vertically or horizontally (UIBoxLayout)

    • Dropped support for YAML style files

    • Better performance and limited memory usage

    • More documentation (gui_concepts)

    • Available Elements:

      • arcade.gui.UIWidget:

        • arcade.gui.UIFlatButton - 2D flat button for simple interactions (hover, press, release, click)

        • arcade.gui.UITextureButton - textured button (use :meth:arcade.load_texture()) for simple interactions (hover, press, release, click)

        • arcade.gui.UILabel - Simple text, supports multiline

        • arcade.gui.UIInputText - field to accept user text input

        • arcade.gui.UITextArea - Multiline scrollable text widget.

        • arcade.gui.UISpriteWidget - Embeds a Sprite within the GUI tree

      • arcade.gui.UILayout:

        • arcade.gui.UIBoxLayout - Places widgets next to each other (vertical or horizontal)

      • arcade.gui.UIWrapper:

        • arcade.gui.UIPadding - Add space around a widget

        • arcade.gui.UIBorder - Add border around a widget

        • arcade.gui.UIAnchorWidget - Used to position UIWidgets relative on screen

      • Constructs

        • arcade.gui.UIMessageBox - Popup box with a message text and a few buttons.

      • Mixins

        • arcade.gui.UIDraggableMixin - Makes a widget draggable.

        • arcade.gui.UIMouseFilterMixin - Catches mouse events that occure within the widget boundaries.

        • arcade.gui.UIWindowLikeMixin - Combination of arcade.gui.UIDraggableMixin and arcade.gui.UIMouseFilterMixin.

    • WIP

      • UIWidgets contain information about preferred sizes

      • UILayouts can grow or shrink widgets, to adjust to different screen sizes

  • Scene Manager.

    • There is now a new arcade.Scene class that can be used to manage SpriteLists and their draw order. This can be used in place of having to draw multiple spritelists in your draw function.

    • Contains special integration with :class:arcade.TileMap using :func:arcade.Scene.from_tilemap which will automatically create an entire scene from a loaded tilemap in the proper draw order.

    • See :ref:platformer_tutorial for an introduction to this concept, and it is used heavily throughout that tutorial.

  • Camera support

    • Easy scrolling with arcade.Camera

    • For an example of this see the example: :ref:sprite_move_scrolling.

    • Automatic camera shake can be added in, see the example: sprite_move_scrolling_shake.

    • Several other examples and tutorials make use of this class, like :ref:platformer_tutorial.

  • Add a set of functions to track performance statistics. See perf_info_api.

  • Added the class arcade.PerfGraph, a subclass of Sprite that will graph FPS or time to process a dispatch-able event line 'update' or 'on_draw'.

    Performance Statistics

  • Documentation

    • Lots of individual documentation updates for commands.

    • The :ref:quick_index has been reorganized to be easier to find commands, and the individual API documentation pages have been broken into parts, so it isn't one large monolithic page.

    • New tutorial for raycasting_tutorial.

    Performance Statistics

    • New tutorial for shader_toy_tutorial.

    • Revamped tutorial: platformer_tutorial.

    • Revamped minimap example: minimap.

    • Moved from AWS hosting to read-the-docs hosting so we can support multiple versions of docs.

    • New example showing how to use the new performance statistics API: performance_statistics_example

    • New example: gui_widgets

    • New example: gui_flat_button

    • New example: gui_ok_messagebox

  • API commands

    • arcade.get_pixel supports getting RGB and RGBA color value

    • arcade.get_three_color_float Returns colors as RGB float with numbers 0.0-1.1 for each color

    • arcade.get_four_color_float Returns colors as RGBA float with numbers 0.0-1.1 for each color\

  • Better PyInstaller Support

    Previously our PyInstaller hook only fully functioned on Windows, with a bit of functionality on Linux. Mac was just completely unsupported and would raise an UnimplementedError if you tried.

    Now we have full out of the box support for PyInstaller with Windows, Mac, and Linux.

    See bundle_into_redistributable for an example of how to use it.

  • Sound

    The sound API remains unchanged, however general stability of the sound system has been greatly improved via updates to Pyglet.

  • Fix for A-star path finding routing through walls

Special thanks to:

  • einarf for performance improvements, texture atlas support, shader toy support, text drawing support, advice on GUI, and more.

  • Cleptomania for Tiled Map support, sound support, and more.

  • eruvanos for the original GUI and all the GUI updates.

  • benmoran56 and everyone that contributes to the excellent Pyglet library we use so much.


r/pythonarcade • • Feb 21 '18

Arcade 1.3.0 has been released

Thumbnail
arcade.academy
2 Upvotes

r/pythonarcade • • Dec 04 '16

Installation instructions for the sound library on Mac OSX

1 Upvotes

How do you install the sound library? I only see Linux instructions.


r/pythonarcade • • May 11 '17

Questions about `Window.set_update_rate` method

2 Upvotes

There is a set_update_rate in class Window.

Are we supposed to override this method, or to invoke it?

Invoking this method on the __init__ of the Window subclass, or at a later point in a setup method, did not produce any effect (that is: did not change the update-rate).

class MyApplication(arcade.Window):

    def __init__(self, width, height):
        super().__init__(width, height)
        self.set_update_rate(0.1):

    def setup(self):
        self.set_update_rate(0.1):

One (ugly) workaround I tried was to override it, and pass my desired value to its super-class version (ignoring the incoming parameter).

def set_update_rate(self, rate):
    # the passed parameter is ignored
    super().set_update_rate(0.1)

I can't imagine this to be the way it was intended. Unfortunately, I also did not find any example where this method is used.

How are we supposed to use this method?

P.S. For the time being I bypassed the whole thing altogether by scheduling periodic invocations to a "custom" update method (called "update_logic" or anything else but "update"). Like this:

def setup(self):
    arcade.schedule(self.my_update, 0.1)

def my_update(self, delta_time):
    # update positions

It would be nice to use the built-in functionality, though.


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 • • May 07 '17

Sample Games Made With The Arcade Library

Thumbnail
arcade.academy
3 Upvotes

r/pythonarcade • • Mar 17 '26

I turned my board game prototype into a multi-threaded Steam game with Python Arcade!

10 Upvotes

Hey everyone, I’ve been working on ODDD (One Dice Dungeon Delve) for a while now. It started at my desk with a single d6 and some scrap paper during a slow afternoon.

As a solo dev, the hardest part was moving from that simple prototype to a production-ready Steam build. I just finished a massive refactor to move all Steam API calls to a background worker thread so the UI never hangs, and implemented a visual loot system where every piece of gear changes your character's sprite.

The Steam page just went live and I’m feeling that mix of relief and terror. I would love to hear what you think of the visual progression!

Steam Page: https://store.steampowered.com/app/4495180/One_Dice_Dungeon_Delve/

Itchio (free Beta): https://stealthstack.itch.io/oddd