Skip to content

Prototype: Scary Vec2s and Nice Sprites - #2219

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

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

Conversation

@pushfoo

@pushfoopushfoo commented Jul 7, 2024

Copy link
Copy Markdown
Member

TL;DR: Proof we canVec2 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
Copy Markdown
MemberAuthor

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

@pushfoo

Copy link
Copy Markdown
MemberAuthor

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

Comment threadarcade/sprite/base.py Outdated
@einarfeinarf mentioned this pull request Jul 8, 2024
@pushfoo
pushfooforce-pushed the scary-vecs-and-nice-sprites branch from 7aeacbd to 1a5886cCompareJuly 19, 2024 00:27
@pushfoo

Copy link
Copy Markdown
MemberAuthor

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

@pushfoo
pushfooforce-pushed the scary-vecs-and-nice-sprites branch 3 times, most recently from b13ab0f to d58a2bdCompareJuly 26, 2024 22:41
@pushfoo
pushfooforce-pushed the scary-vecs-and-nice-sprites branch from d58a2bd to e168e82CompareJuly 26, 2024 22:49
@DragonMoffonDragonMoffon added this to the Future milestone Sep 30, 2024
@DragonMoffon

Copy link
Copy Markdown
Collaborator

Maybe set this PR to draft for now?

@pushfoo
pushfoo marked this pull request as draft October 1, 2024 00:41
@pushfoo

Copy link
Copy Markdown
MemberAuthor

@einarf@Cleptomania Given the pyglet 3.0 work, should I close this or leave it here as a reminder to look into the vectors?

@einarf

Copy link
Copy Markdown
Member

We can just leave it here for now

Sign up for freeto 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

@pushfoo@DragonMoffon@einarf