Prototype: Scary Vec2s and Nice Sprites
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
git checkout upstream/scary-vecs-and-nice-spritesor however you have your remotes instealledpip install -I -e .[dev]- This is very important
- Do it every time you switch to or back from this branch
- 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
- For
BasicSpriteand subclasses, the following are nowVec2:.sizeis now aVec2backed by._size.positionis now aVec2.scaleis now aVec2
_widthand_heightare now compatibility properties for any subclasses we missed- 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:
- [x] #2226
- [x] #2021
Sprites pass:
- [x]
pytest tests/unit - [x]
pyright - [x]
./make./py format+ruff check arcade
Otherwise, no guarantees:
Follow-up Work
- [ ] Verify the tests cover what they should
- [ ] Perf tests and metrics to decide how to proceed with:
Right, I need to figure out the zipballs since it's dependent on https://github.com/pyglet/pyglet/pull/1154
Zipball's fixed, but the other pyright issues belong in #2183.
I've dropped the zipball commits during rebase onto development. We're on pyglet==2.1dev4 now.
Maybe set this PR to draft for now?
@einarf @Cleptomania Given the pyglet 3.0 work, should I close this or leave it here as a reminder to look into the vectors?
We can just leave it here for now