python Programming Glossary: self.onground
Add scrolling to a platformer in pygame http://stackoverflow.com/questions/14354171/add-scrolling-to-a-platformer-in-pygame self x y Entity.__init__ self self.xvel 0 self.yvel 0 self.onGround False self.image Surface 32 32 self.image.fill Color #0000FF.. running platforms 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.. 12 if left self.xvel 8 if right self.xvel 8 if not self.onGround # only accelerate with gravity if in the air self.yvel 0.3 #..
|