[Tutor] movement controls
snet-1 at msn.com
snet-1 at msn.com
Fri Mar 19 01:51:24 CET 2010
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'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100319/e357fb54/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: New Text Document.txt
URL: <http://mail.python.org/pipermail/tutor/attachments/20100319/e357fb54/attachment-0001.txt>
More information about the Tutor
mailing list