Skip to content

Commit

Permalink
Use the angles from the array when a player scores
Browse files Browse the repository at this point in the history
  • Loading branch information
aldatsa committed Feb 3, 2015
1 parent 5371e0e commit 2461ff1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 2461ff1

Please sign in to comment.