¡@

Home 

python Programming Glossary: self.xvel

Add scrolling to a platformer in pygame

http://stackoverflow.com/questions/14354171/add-scrolling-to-a-platformer-in-pygame

Player Entity def __init__ self x y Entity.__init__ self self.xvel 0 self.yvel 0 self.onGround False self.image Surface 32 32 self.image.fill.. if self.onGround self.yvel 10 if down pass if running self.xvel 12 if left self.xvel 8 if right self.xvel 8 if not self.onGround.. self.yvel 10 if down pass if running self.xvel 12 if left self.xvel 8 if right self.xvel 8 if not self.onGround # only accelerate..