[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] loading images and sounds
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] loading images and sounds
- From: Charles Joseph Christie II <sonicbhoc@xxxxxxxxx>
- Date: Tue, 1 May 2007 14:32:48 -0400
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Tue, 01 May 2007 14:34:12 -0400
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=rrJOXxMmqqKjvdYhEtA+cX/KeD9VHCea0WdKgSQgaPI54eq6YOvpkwpnZn4cjFXzOM75sgDU5ySi97jyM6+ocxQU2ASYOXTSIlm2lLFZFv6ixivu3y5ucJlhTkeRr3ioDN4vlJx1WI1i04D6i6F0kQGHvSHa6MmO80YDvo0XeV8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=Hy3tUOX0YcP91w+VFm2ysD0NNrQS3qmg2ZDnW92yQ5weNS7+52n76HMsFfgkyXhLGoQgF7G0yoKot5aV2SZHwZ/a7ZKJKnVkkgQbnFiVWwrHXtr+fT1AQudh+/TSLlKIU6qT9RwfdLFBFA2EwkTLGHDd0lsM0nViDpKeCLOCg1k=
- In-reply-to: <20070501182851.GB9374@karnov.dreamhost.com>
- References: <200705010753.51648.sonicbhoc@gmail.com> <200705011210.16491.sonicbhoc@gmail.com> <20070501182851.GB9374@karnov.dreamhost.com>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
- User-agent: KMail/1.9.6
On Tuesday 01 May 2007 02:28:51 pm James Paige wrote:
> On Tue, May 01, 2007 at 12:10:16PM -0400, Charles Joseph Christie II wrote:
> > On Tuesday 01 May 2007 11:58:17 am DR0ID wrote:
> > > Charles Joseph Christie II schrieb:
> > > > On Tuesday 01 May 2007 09:48:04 am Samuel Mankins wrote:
> > > >> I think I ran into the problem before. What it is is that the
> > > >> load_image function does is return the image, and the image's
> > > >> rectangle. All you've got to do is delete the bit at the end of the
> > > >> function that says "return image, image.get_rect" and replace it
> > > >> with "return image".
> > > >>
> > > >> Charles Joseph Christie II wrote:
> > > >>> So, I have a helpers.py file that I imported into all of my files.
> > > >>> It loads sounds, images and music. However, when I load an image, I
> > > >>> can't do anything with it because pygame keeps saying that "tuple
> > > >>> object has no attribute 'blit'" and I can't do anything.
> > > >>>
> > > >>> I noticed at the bottom of this helper file, it says "return image,
> > > >>> image.get_rect()" on it. What should I do with that then?
> > > >>>
> > > >>> Here is the file that is causing the problem and the helpers.py
> > > >>> file. this is due on the 3RD OF MAY OH DANG IT GOT HERE FAST!!! :P
> > > >>>
> > > >>> (I said I wouldn't be rushing to get it out at the end of the
> > > >>> deadline and, hey look, I'm rushing to get it out at the end of the
> > > >>> deadline. Go figure. <_< )
> > > >>>
> > > >>> Help is appreciated! I need all the help I can get!
> > > >
> > > > Well, it's problem after problem, bug after bug over here. I fixed it
> > > > so that it loads images (Thanks!). I added my sprites to the
> > > > pygame.sprite.RenderUpdates() sprite group and (after fixing a couple
> > > > syntax errors) it worked!
> > > >
> > > > ...OK, not really. It almost worked. It returned no errors, yet the
> > > > bullets don't appear on-screen. I put the code in SVN just a second
> > > > ago if you want to check it out
> > > > (svn://commons.game-host.org:3670/TypeNine) and I can provide a zip
> > > > if you want, too. It's weird though... I think it's because I didn't
> > > > put attacking in the def update() section but instead put
> > > > self.attack() in there and made a def attack() in there to fire the
> > > > bullets. I think that's the reason, anyway...
> > >
> > > Hi again
> > >
> > > I looked at it for a moment and found following:
> > >
> > > 1.)stg.py
> > > in Player.update()
> > > uncomment slef.image.blit(self.image, ...) # this cuases a
> > > segmentation fault on my machine, winxp
> > >
> > > 2.)you have to add a Bullet.png in the img directory
> > >
> > > 3.) in stg.py in Boss.update() same line as in Player.update()
> > >
> > > 4.) in bullets.py in the Bullets class the same error as in the other
> > > classe in update()!
> > >
> > > otherwise it seem to work, although I cant see anything happen on
> > > screen except of the typing (cant see any bullet??).
> > >
> > > well done.
> > >
> > > ~DR0ID
> > >
> > >
> > >
> > > PS: if you want to chat, I'm currently online in the IRC on #pygame
> > > :-)
> >
> > I think you have the old code... really really old. I uncommented the
> > player image stuff ages ago and I have a (really ugly) bullet in my img
> > folder. Did you use svn to get the code or what? I sent another email, it
> > should have my most up-to-date junk on it.
>
> I had the same problems that DR0ID had, and I got the code from
> subversion
>
> I think you forgot to svn add img/Bullet.png
Yeah, I did. :P (I just fixed it, try it again)