Skip to content

figure[i].x += dx AttributeError: 'int' object has no attribute 'x' python #954

Description

@newinpython1

Hello everyone, I'm a beginner in Python and while I was writing a Tetris game with the pygame library I encountered the errors figure[i].x += dx
AttributeError: 'int' object has no attribute 'x' I'll throw off the last 5 lines if necessary, I'll throw off all the lines of the project, I don't understand why this error comes up, can anyone help?
#move x
figure_old = deepcopy(figure)
for i in range(4):
figure[i].x += dx <----
if not check_borders():
figure = deepcopy(figure_old)
break

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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