Skip to content

Sync arcade-a-primer with the updated tutorial - #942

Open
realpython-bot wants to merge 1 commit into
masterfrom
maintenance/arcade-python-game-framework-20261111
Open

realpython-bot wants to merge 1 commit into
masterfrom
maintenance/arcade-python-game-framework-20261111

Conversation

@realpython-bot

Copy link
Copy Markdown
Collaborator

Syncs arcade-a-primer with the maintenance update of Arcade: A Primer on the Python Game Framework, which moves the tutorial from arcade 2.1 to arcade 3.3.

Changes

  • arcade_basic_oop.py, arcade_draw_shapes.py, arcade_game.py: on_draw() now starts with self.clear(). In arcade 3.x, arcade.start_render() inside on_draw() raises RuntimeError on the second frame.
  • arcade_game.py: FlyingSprite.update() takes delta_time and passes it to super().update(). arcade 3.x SpriteList.update() passes delta_time to every sprite, so the old signature raised TypeError.
  • arcade_draw_shapes.py: replaced the removed draw_rectangle_filled(), draw_lrtb_rectangle_filled(), and draw_xywh_rectangle_filled() with draw_rect_filled(arcade.XYWH(...)), draw_lrbt_rectangle_filled(), and draw_lbwh_rectangle_filled(). The shapes and positions are the same.
  • Added requirements.txt pinning arcade==3.3.3, matching the article's install command.

Verification

  • Ran all four scripts on Python 3.13 with arcade==3.3.3 under Xvfb. Each one ran until the timeout with no exceptions. Before this change, three of them crashed.
  • Ran a headless check of SpaceShooter that adds an enemy and a cloud and calls all_sprites.update(), on_update(), and on_draw(). It passes now and raised TypeError before the change.
  • ruff@0.14.1 format --check and ruff@0.14.1 check both pass.

Article draft (update clone): https://realpython.com/pbjt/blog/post/2637/change/
Maintenance card: https://trello.com/c/O1XQ968m

🤖 Generated with Claude Code

…on the Python Game Framework

Port the scripts to arcade 3.3: call self.clear() instead of
arcade.start_render() in on_draw(), accept delta_time in
FlyingSprite.update(), replace the removed rectangle drawing functions,
and pin arcade==3.3.3 in requirements.txt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant