On Tue, Sep 16, 2008 at 11:24 AM, Glenn Ein <[EMAIL PROTECTED]> wrote:

>
> The error message says:
>
> line 794, in game
> player = Player()
> line 300, in __init__
> self.width = self.images.width
>
> Atribbute error: 'list' object has no atribbute 'width'

This is telling you that self.images has no width attribute.
This is quite clear when we look at the definition of self.images:
  self.images =
[load_image("player-run1.png"),load_image("player-run2.png"),
load_image("player-run3.png")]

Self.images is not a single image, it's a collection of images.  What would
a width of a collection of images be?
I imagine what you want is the width of a particular image.  Since this is
an animation, we can make the assumption that all of the images have the
same dimensions.
Now this doesn't have to be the case, but it likely is.
So really, it doesn't matter which width and height you use.
Might as well use the first one!
so your line needs to read:
self.width = self.images[0].width
Which translates to:
set the class' width to the width of the first image in my list of images.

HTH,
-Luke

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to