Skip to content

'tuple' object has no attribute 'x' #1479

@alderven

Description

@alderven

Steps to reproduce

Run code from the following example:
https://api.arcade.academy/en/latest/examples/sprite_move_scrolling_shake.html

Getting error:

"C:\Program Files\Python310\python.exe" D:\PROGRAMMING\temp\arcade_sprite_move_scrolling_shake\arcade_sprite_move_scrolling_shake.py 
Traceback (most recent call last):
  File "D:\PROGRAMMING\temp\arcade_sprite_move_scrolling_shake\arcade_sprite_move_scrolling_shake.py", line 224, in <module>
    main()
  File "D:\PROGRAMMING\temp\arcade_sprite_move_scrolling_shake\arcade_sprite_move_scrolling_shake.py", line 220, in main
    arcade.run()
  File "C:\Program Files\Python310\lib\site-packages\arcade\window_commands.py", line 323, in run
    pyglet.app.run()
  File "C:\Program Files\Python310\lib\site-packages\pyglet\app\__init__.py", line 107, in run
    event_loop.run(interval)
  File "C:\Program Files\Python310\lib\site-packages\pyglet\app\base.py", line 186, in run
    timeout = self.idle()
  File "C:\Program Files\Python310\lib\site-packages\pyglet\app\base.py", line 247, in idle
    self.clock.call_scheduled_functions(dt)
  File "C:\Program Files\Python310\lib\site-packages\pyglet\clock.py", line 262, in call_scheduled_functions
    item.func(now - item.last_ts, *item.args, **item.kwargs)
  File "C:\Program Files\Python310\lib\site-packages\arcade\application.py", line 318, in _dispatch_updates
    self.dispatch_event('on_update', delta_time)
  File "C:\Program Files\Python310\lib\site-packages\pyglet\window\__init__.py", line 1363, in dispatch_event
    super().dispatch_event(*args)
  File "C:\Program Files\Python310\lib\site-packages\pyglet\event.py", line 427, in dispatch_event
    raise e
  File "C:\Program Files\Python310\lib\site-packages\pyglet\event.py", line 422, in dispatch_event
    if getattr(self, event_type)(*args):
  File "D:\PROGRAMMING\temp\arcade_sprite_move_scrolling_shake\arcade_sprite_move_scrolling_shake.py", line 185, in on_update
    self.camera_sprites.shake(shake_vector,
  File "C:\Program Files\Python310\lib\site-packages\arcade\camera.py", line 152, in shake
    self.shake_velocity += velocity
  File "C:\Program Files\Python310\lib\site-packages\pyglet\math.py", line 106, in __add__
    return Vec2(self.x + other.x, self.y + other.y)
AttributeError: 'tuple' object has no attribute 'x'

System Info

OS: Win 11
Python: 3.10
Arcade: 2.6.17

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions