¡@

Home 

python Programming Glossary: self.yvel

Add scrolling to a platformer in pygame

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

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 up # only jump if on the ground if self.onGround self.yvel 10 if down pass if running self.xvel 12 if left self.xvel 8.. self.onGround # only accelerate with gravity if in the air self.yvel 0.3 # max falling speed if self.yvel 100 self.yvel 100 if not..