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
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
using self.figures= [] instead of self.figures= [[]].
and also i had to change few lines in my collision functions from this if X== self.figures[counter1].[counter2].getX():
to this if X== self.figures[counter1].squares[counter2].getX():