Skip to content

Prototype: Scary Vec2s and Nice Sprites#2219

Draft
pushfoo wants to merge 29 commits intodevelopmentfrom
scary-vecs-and-nice-sprites
Draft

Prototype: Scary Vec2s and Nice Sprites#2219
pushfoo wants to merge 29 commits intodevelopmentfrom
scary-vecs-and-nice-sprites

Conversation

@pushfoo
Copy link
Member

@pushfoo pushfoo commented Jul 7, 2024

TL;DR: Proof we can Vec2 all *Sprite without destroying the universe!

[ Obligatory Skrillex Noises ]

Note

The remaining pyright issues belong in #2183

How to try it

In your Arcade clone

  1. git checkout upstream/scary-vecs-and-nice-sprites or however you have your remotes instealled
  2. pip install -I -e .[dev]
    • This is very important
    • Do it every time you switch to or back from this branch
  3. Proceed as normal, see what breaks

In your Project

For the latest unstable version:
arcade@git+https://github.com/pythonarcade/arcade/arcade.git@scary-vecs-and-nice-sprites#egg=arcade

You can also pin specific commits using a zipball link, but that's more convoluted.

Changes

  1. For BasicSprite and subclasses, the following are now Vec2:
    • .size is now a Vec2 backed by ._size
    • .position is now a Vec2
    • .scale is now a Vec2
  2. _width and _height are now compatibility properties for any subclasses we missed
  3. Dependent functions are mostly updated

What's not changed

Anything outside the sprites really. Seriously. There's a sound tweak to get it to pass and run, but otherwise, not even tests.

Current Code Quality

Already done:

Sprites pass:

  • pytest tests/unit
  • pyright
  • ./make./py format + ruff check arcade

Otherwise, no guarantees:
image

Follow-up Work

  • Verify the tests cover what they should
  • Perf tests and metrics to decide how to proceed with:

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants