[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] stumped by basic python
- To: pygame-users@xxxxxxxx
- Subject: [pygame] stumped by basic python
- From: Knapp <magick.crow@xxxxxxxxx>
- Date: Thu, 5 Jan 2006 15:24:05 -0800
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Thu, 05 Jan 2006 18:24:10 -0500
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=GOyxzYBiM9aA4JM7glZUoxE4mGi9W9zts0qDasKODvAjDpwH2p6vOVtgvCt9WAkA86soziYBiGL4d5lSZuoAoyvubFwLcRpl9C+Bzvv0CyShelPHtwBPv+C3PSbzDw42T8d1tLGv3/qwtdeRdIcLq+sKxEcx0VUxhuul3v10ZJY=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
I know this must be a dumb Noob question but I am stumped.
I want to rewrite this so that I can put it all in a loop calling on
the data in the list to make the functions and fill in the data. What I
don't know if how to come up with "sunModel" and the "mercuryModel" etc
in the loop based on the list names and then set the data to that. Make
sense? The way I started was to hand code it but that is crazy.
Thanks
Douglas
sol1=(('sun', 'sunmap.jpg', 139),('mercury'. 'mercurymap.jpg', 2.4297),
('earth', 'earthmap1k.png', 6.378), ('moon', 'moonmap1k.png' ,1.738))
sunModel = loader.loadModelCopy("BasicPlanet2.egg")
sunModel.reparentTo(render)
sunModel.setScale(139)
tex = loader.loadTexture('sunmap.jpg')
sunModel.setTexture(tex,1)
mercuryModel = loader.loadModelCopy("BasicPlanet2.egg")
mercuryModel.reparentTo(render)
mercuryModel.setScale(2.4397)
tex = loader.loadTexture('mercurymap.jpg')
mercuryModel.setTexture(tex,1)
earthModel = loader.loadModelCopy("BasicPlanet2.egg")
earthModel.reparentTo(render)
earthModel.setScale(6.378)
tex = loader.loadTexture('earthmap1k.png')
earthModel.setTexture(tex,1)
moonModel = loader.loadModelCopy("BasicPlanet2.egg")
moonModel.reparentTo(render)
moonModel.setScale(1.738)
tex = loader.loadTexture('moonmap1k.png')
moonModel.setTexture(tex,1)