[Tutor] Movement controls useing pygame

Luke Paireepinart rabidpoobear at gmail.com
Fri Mar 19 10:01:14 CET 2010


Are you just reposting this exact same e-mail to the list because you didn't
see my reply to the other one, or are you ignoring what I said and posting
the same message again, hoping someone else will answer?
I hope it's not the latter, that's kind of insulting.  The least you could
do is say that my idea didn't make sense or wouldn't work for you in this
case.

-Luke

On Thu, Mar 18, 2010 at 7:45 PM, <mark-ireland at msn.com> wrote:

>  A little stuck and could do with any sudjestions.
>
> Aim:-
> When the character goes past the middle of the screen, the background &
> level move downwards so the character can get to higher places, think sonic
> the hedgehog.
>
> This is the bit I'm having problems with, I can get the character to get to
> the center, the background moves up & down but the character won't go back
> down when the level returns to normal height.
>
>     if bkGroundRect['rect'].top < 0 and charRect['rect'].top <
> winCenterRect.top:
>
>         bkGroundRect['rect'].top += spY
>         platRect['rect'].top += spY
>         jumpRect.top += spY
>         charRect['dir'] = STOP
>
>
>     if levelRect['rect'].bottom > winHeight and charRect['rect'].centery ==
> winCenterx:
>             bkGroundRect['rect'].bottom -= spY
>             platRect['rect'].bottom -= spY
> #            jumpRect.bottom -= spY
>             charRect['dir'] = STOP
>
>   #--this won't execute ? --#
>     if levelRect['rect'].bottom <= winHeight:
>         if charRect['rect'].centery >= winCenterx and
> charRect['rect'].centerx < jumpRect.centerx:
>             charRect['dir'] = DOWN
>
> I've included the whole code as a note pad so the above makes more sense,
> don't worry about all the comments, that's just for my convenience.
>
> Thanks guys
>
> Mark
>
> 'knight meets wall, wall won't let knight pass, knight says 'neh'
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100319/8e7fa172/attachment-0001.html>


More information about the Tutor mailing list