Commit 806daeb
authored
Fix app crashes when touching bomb by passing correct type to
TLDR;
* App crashes when touching a bomb with error.
* `AttributeError: 'tuple' object has no attribute 'x'`
* Made the following changes
* added `from pyglet.math import Vec2` to the top of the file
* passed `Vec2` to `camera.shake()` instead of tuple
* old line: `camera.shake((4, 7))`
* new line: `camera.shake(Vec2(4, 7))`
I initially thought this was intended behavior but I realized the app was actually just crashing.
The offending line was calling `camera.shake()` which according to it's definition in `./venv/lib/python3.11/site-packages/arcade/camera.py` expects a `Vec2` as it's argument which is being imported in that file with `from pyglet.math import Mat4, Vec2, Vec3` but the call to `camera.shake` was getting a `tuple` hence the `AttributeError`.camera.shake() (#1928)1 parent d872405 commit 806daeb
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
254 | 256 | | |
255 | 257 | | |
256 | 258 | | |
257 | | - | |
| 259 | + | |
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
| |||
0 commit comments