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

Re: [pygame] Rockhunt



What's self.idealxpix and self.idealypix?

On 23 Aug 2005 06:46:14 -0700, Aaron Maupin <maupin@xxxxxxxxxxxxxx> wrote:
> andrew baker wrote:
> > I'd really like to see motion from one cell to the next, but it's
> > still a pretty good demo.
> 
> Right now I'm trying to copy the feel of the C64 Boulderdash, which had
> a smoothly-scrolling screen but sudden movements between cells.
> 
> > Are you sharing code, because I'd like to
> > take a look at your scroll routine.  I need one for my engine.
> 
> Mine is fairly simple, and the others mentioned in this thread are
> probably better!  Anyway, here's mine (email me if you'd like the code):
> no matter how big the map, there are only a set number of sprites.  Each
> sprite has self.idealxpix and self.idealypix, and its update continually
> tries to add or subtract to its current position to match its ideal
> position.  The scroll function just adds/subtracts to every sprite's
> idealxpix and/or idealypix.
> 
> When a sprite gets too far off the edge of the window, it is teleported
> to the opposite side.  (Like using logs to transport huge stone blocks.)
> 
> Aaron
> 
> 


-- 
Andrew Ulysses Baker
"failrate"