Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/data/graphics/xolympics
diff options
context:
space:
mode:
Diffstat (limited to 'data/graphics/xolympics')
-rw-r--r--data/graphics/xolympics10
1 files changed, 6 insertions, 4 deletions
diff --git a/data/graphics/xolympics b/data/graphics/xolympics
index 51be828..78f485a 100644
--- a/data/graphics/xolympics
+++ b/data/graphics/xolympics
@@ -15,6 +15,7 @@ from pygame.color import *
from pippy.physics import box2d
+
class XOlympicsGame:
def __init__(self):
self.rightscore = self.leftscore = 0
@@ -47,13 +48,13 @@ class XOlympicsGame:
self.world.add.rect((0, -20), 25, self.height,
dynamic=False, density=1.0,
restitution=0.16, friction=0.5)
- self.leftplayer = self.world.add.poly(( self.width * 0.25, 81.0 ), [(-109.9405166666667, -64.244016666666653), (110.60718333333335, -63.089316666666605), (-0.66666666666668561, 127.33333333333337)], dynamic=True, density=1.0, restitution=0.16, friction=0.5, screenCoord=False)
+ self.leftplayer = self.world.add.poly((self.width * 0.25, 81.0), [(-109.9405166666667, -64.244016666666653), (110.60718333333335, -63.089316666666605), (-0.66666666666668561, 127.33333333333337)], dynamic=True, density=1.0, restitution=0.16, friction=0.5, screenCoord=False)
# add the right border and player (blue)
self.world.set_color((0, 0, 255))
self.world.add.rect((self.width, -20), 25, self.height,
dynamic=False, density=1.0,
restitution=0.16, friction=0.5)
- self.rightplayer = self.world.add.poly(( self.width * 0.75, 81.0 ), [(108.94051666666667, -65.976066666666611), (2.6666666666666288, 127.33333333333337), (-111.60718333333341, -61.357266666666646)] , dynamic=True, density=1.0, restitution=0.16, friction=0.5, screenCoord=False)
+ self.rightplayer = self.world.add.poly((self.width * 0.75, 81.0), [(108.94051666666667, -65.976066666666611), (2.6666666666666288, 127.33333333333337), (-111.60718333333341, -61.357266666666646)], dynamic=True, density=1.0, restitution=0.16, friction=0.5, screenCoord=False)
# we're getting 2 grounds - grey and green. why?
def run(self):
@@ -108,7 +109,7 @@ class XOlympicsGame:
if self.rightRPress:
self.rightplayer.ApplyForce(box2d.b2Vec2(self.forcespeed, 0), self.rightplayer.GetWorldCenter())
if self.rightDPress:
- self.rightplayer.ApplyImpulse(box2d.b2Vec2(0 ,-self.jumpforce), self.rightplayer.GetWorldCenter())
+ self.rightplayer.ApplyImpulse(box2d.b2Vec2(0, -self.jumpforce), self.rightplayer.GetWorldCenter())
if self.rightJump:
if self.rightplayer.GetWorldCenter().y < 0.75:
self.rightplayer.ApplyImpulse(box2d.b2Vec2(0, self.jumpforce), self.rightplayer.GetWorldCenter())
@@ -138,7 +139,8 @@ class XOlympicsGame:
pygame.display.flip()
# Try to stay at 30 FPS
- self.clock.tick(30) # originally 50
+ self.clock.tick(30) # originally 50
+
def main():
pygame.init()