[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Some Platforms



El Sábado, 19 de Febrero de 2005 23:25, David Holland escribió:
> In linux I got these warnings :-
> python rects.py
> rects.py:313: SyntaxWarning: name 'interactGroup' is
> assigned to before global declaration
>   def main():
> rects.py:313: SyntaxWarning: name 'botGroup' is
> assigned to before global declaration
>   def main():
> rects.py:313: SyntaxWarning: name 'itemGroup' is
> assigned to before global declaration
>   def main():
> rects.py:313: SyntaxWarning: name 'bombGroup' is
> assigned to before global declaration
>   def main():
> rects.py:313: SyntaxWarning: name 'platGroup' is
> assigned to before global declaration
>   def main():

I was avoiding these warnings, but now I swaped the lines like:
	botGroup = pygame.sprite.Group()
	global botGroup

and warnings desappeared

>
> The only problem with it is lack of instructions as a
> user.

This is because it's just a sketch, a kind of 'platform's engine'.
I get confused with others pyGame scrollers code, so I started this from 
scratch.
When I get sattisfied with it, I'll add graphics and design levels. In other 
words, fun will start!

I was thinking how to make a scroller from this. I think i need:
	a way to move all sprites in function of the player's movement, and
	a way to remove sprites from groups when they get out of the screen

This isn't a self-note, I wonder how to do it efficiently.


> The code seems clear from my little look at it and
> well commentated (I do speak Spanish as well)

Y para qué respondí en inglés entonces?? :)

>
>  --- Manuel <frame_256@xxxxxxxxxxxx> wrote:
> > I spent the last three days learning pygame, and
> > sketching a platforms game.
> > It has very silly physics, and no level definition
> > yet.
> > As it is my first attempt with pyGame, it for sure
> > contains lots of errors and
> > could be improved a lot.
> >
> > So what do you think about the current state??
> > Also look at it's awesome graphics and AI!!!
> > And sorry for the spanish variables, but I do speak
> > spanish.
> >
> >
> > ATTACHMENT part 2 application/x-python name=rects.py
>
> ___________________________________________________________
> ALL-NEW Yahoo! Messenger - all new features - even more fun!
> http://uk.messenger.yahoo.com