From 2461ff12f7eba053884917005e4a8796d467e86f Mon Sep 17 00:00:00 2001 From: Asier Iturralde Sarasola Date: Tue, 3 Feb 2015 22:41:00 +0100 Subject: [PATCH] Use the angles from the array when a player scores --- source/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/main.c b/source/main.c index 06ce7bc..fbc11a7 100644 --- a/source/main.c +++ b/source/main.c @@ -44,7 +44,7 @@ License: GPL v3 #define PADDLE_WIDTH 8 #define SCORE_LIMIT 10 -int initial_angles[] = {0, 60, 120, 180, 240, 300, 360}; +int initial_angles[] = {120, 180, 240, 300, 0, 60}; typedef struct { double x; @@ -713,7 +713,7 @@ int main(void) { b.x = SCREEN_WIDTH / 2 - 1 - BALL_WIDTH / 2; b.y = SCREEN_HEIGHT / 2 - 1 - BALL_HEIGHT / 2; - b.angle = rand_lim(180) + 270; + b.angle = initial_angles[rand_lim(2) + 3]; // 300, 0, 60 b.speed = INITIAL_SPEED; @@ -753,8 +753,7 @@ int main(void) { b.x = SCREEN_WIDTH / 2 - 1 - BALL_WIDTH / 2; b.y = SCREEN_HEIGHT / 2 - 1 - BALL_HEIGHT / 2; - b.angle = rand_lim(180) + 90; - + b.angle = initial_angles[rand_lim(2)]; // 120, 180, 240 b.speed = INITIAL_SPEED; } else {