Hello p3d forum
I’ve started to learn panda3d recently.
I try to create tetris game as my first one. And i’ve run into a problem. My code is working but when i try to add more classes i get error which i can’t fix myself.
My game uses
plane.egg model from
asteroids example. And my texture for tetris block
Posting 2 code snippets here/ with and without additional class.
AttributeError: 'list' object has no attribute 'squares'
Could you please provide the line number that’s throwing that error?
You initialize self.figures as a list of list instead of a list of Figure objects. As the attribute error says, list objects do not have a squares attribute, but your Figure class does.
Oh thank you so much. . I was like wth i can’t do it
I guess i have to practice python more.
So the solution was
self.figures=  instead of
and also i had to change few lines in my collision functions from this
if X== self.figures[counter1].[counter2].getX():
if X== self.figures[counter1].squares[counter2].getX():
Now its working)