]> git.localhorst.tv Git - sdl-test7.git/blobdiff - src/pong/Match.cpp
made the game a bit more interesting :)
[sdl-test7.git] / src / pong / Match.cpp
index 683defe191eb9c154d564de9abf0922694d9563c..229a8fce034fd127c9303956e613d9b33099bb8c 100644 (file)
@@ -29,15 +29,16 @@ Match::Match(void)
 , scoreFont(TTF_OpenFont("data/font/Magra-Regular.ttf", 30))
 , leftScoreText(0)
 , rightScoreText(0)
-, paddleSpeed(150)
+, paddleSpeed(250)
 , worldWidth(800)
 , worldHeight(480)
 , ball(10)
 , secondBall(7)
+, thirdBall(7)
 , leftPaddle(Entity::Vector(10, 100))
 , rightPaddle(Entity::Vector(10, 100))
-, topWall(Entity::Vector(800, 10))
-, bottomWall(Entity::Vector(800, 10))
+, topWall(Entity::Vector(800, 20))
+, bottomWall(Entity::Vector(800, 20))
 , leftWall(Entity::Vector(10, 480))
 , rightWall(Entity::Vector(10, 480))
 , entities()
@@ -49,13 +50,17 @@ Match::Match(void)
        }
 
        ball.SetPosition(Entity::Vector(400, 240));
-       ball.SetVelocity(Entity::Vector(180, 180));
-       ball.SetMaxVelocity(500.0f);
+       ball.SetVelocity(Entity::Vector(190, 190));
+       ball.SetMaxVelocity(750.0f);
 
        secondBall.SetPosition(Entity::Vector(300, 240));
-       secondBall.SetVelocity(Entity::Vector(-20, -20));
+       secondBall.SetVelocity(Entity::Vector(-100, -100));
        secondBall.SetMaxVelocity(600.0f);
 
+       thirdBall.SetPosition(Entity::Vector(250, 440));
+       thirdBall.SetVelocity(Entity::Vector(100, 100));
+       thirdBall.SetMaxVelocity(600.0f);
+
        leftPaddle.SetPosition(Entity::Vector(0, 200));
        rightPaddle.SetPosition(Entity::Vector(790, 280));
 
@@ -65,7 +70,7 @@ Match::Match(void)
        leftPaddle.SetStatic();
        rightPaddle.SetStatic();
 
-       topWall.SetPosition(Entity::Vector(0, -10));
+       topWall.SetPosition(Entity::Vector(0, -20));
        rightWall.SetPosition(Entity::Vector(800, 0));
        bottomWall.SetPosition(Entity::Vector(0, 480));
        leftWall.SetPosition(Entity::Vector(-10, 0));
@@ -75,9 +80,10 @@ Match::Match(void)
        bottomWall.SetStatic();
        leftWall.SetStatic();
 
-       entities.reserve(8);
+       entities.reserve(9);
        entities.push_back(&ball);
        entities.push_back(&secondBall);
+       entities.push_back(&thirdBall);
        entities.push_back(&leftPaddle);
        entities.push_back(&rightPaddle);
        entities.push_back(&topWall);