Panda3d/Python class problem <novice>

Hello p3d forum :fox_face:
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. :bear:
My game uses plane.egg model from asteroids example. And my texture for tetris block

A2 Hosting, Inc. » Web Hosting Grown Up

Posting 2 code snippets here/ with and without additional class.

SnipSave

I get 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 :grinning:
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():

Now its working)