[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Strategies for platformers



> > What are the pros and cons of this strategy?
> 
> This is what I would like to know from you !
> As I see it, the advantage is that it is quite easy to develop a complicated
> pattern for enemies; e.g. one character might move at first up and down, and
> then left and right :
> 
> speedX =[0,0,0,0,5,5,-5,-5]
> speedY =[5,5,-5,-5,0,0,0,0]
> and you can even think about much more complicated patterns.

Well, if the only pro is patterns, then I don't think it's worth it (It
totally depends on what you want/need the game to do, of course).  A 2D
physics model seems more flexible, and can be implemented pretty easily.


> > This is one approach I've seen discussed before.  On the mailing list
> > look for the subject "Smooth animation".  I don't know if a conclusion
> > was ever reached, though.
> 
> Thanks for the info. I have found that thread and got some ideas; but I
> still do not get it.
> And what is your approach on this issue ?

Well, as I haven't really done anything complex with platformers, and my
platform is an AMD 1800, It's not really an issue.  I just cap the
framerate at 40fps, similar to what's done in the chimp example.


> I mean that if the hero jumps from the bottom of a platform (see below) it
> does not have to stop jumping immediately as it detect a collision with the
> platform. Instead, it has to continue its jumping and "land" onto the
> platform.
> 
> >
> > So you want the charactor to 'bump his head' on platforms above him when
> > he jumps into them?  Or to pass right through them on the way up?
> 
> Pass through and land on the upper part of the platform (e.g. "Manic Miner
> style")

Well, the first thing I'd try is to detect a collision, then do a quick
check if the charactor is moving in the upward direction, just ignore
the collision.

Shandy


-- 
+-------------------------------------------------------------+
| Shandy Brown                               Digital Thinkery |
| shandy@geeky.net             http://www.digitalthinkery.com |
+-------------------------------------------------------------+

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org