Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototype: Scary Vec2s and Nice Sprites #2219

Open
wants to merge 29 commits into
base: development
Choose a base branch
from

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:

@pushfoo
Copy link
Member Author

pushfoo commented Jul 7, 2024

Right, I need to figure out the zipballs since it's dependent on pyglet/pyglet#1154

@pushfoo
Copy link
Member Author

pushfoo commented Jul 7, 2024

Zipball's fixed, but the other pyright issues belong in #2183.

arcade/sprite/base.py Outdated Show resolved Hide resolved
@einarf einarf mentioned this pull request Jul 8, 2024
@pushfoo pushfoo force-pushed the scary-vecs-and-nice-sprites branch from 7aeacbd to 1a5886c Compare July 19, 2024 00:27
@pushfoo
Copy link
Member Author

pushfoo commented Jul 19, 2024

I've dropped the zipball commits during rebase onto development. We're on pyglet==2.1dev4 now.

@pushfoo pushfoo force-pushed the scary-vecs-and-nice-sprites branch 3 times, most recently from b13ab0f to d58a2bd Compare July 26, 2024 22:41
@pushfoo pushfoo force-pushed the scary-vecs-and-nice-sprites branch from d58a2bd to e168e82 Compare July 26, 2024 22:49
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