From 9389cc62a79a534bf248f620eb495d8584465d27 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Thu, 25 Mar 2021 16:34:15 -0400 Subject: ball: Add spin direction and radius --- (limited to 'src') diff --git a/src/ball.c b/src/ball.c index 8a00d7d..60ebc74 100644 --- a/src/ball.c +++ b/src/ball.c @@ -27,12 +27,15 @@ struct db_ball { int y; int r; int a; + int d; + double sr; int s; struct db_ball *next; }; struct db_ball * -db_ball_new(int x, int y, int r, int a, int s, struct db_ball *prev) +db_ball_new(int x, int y, int r, int a, int d, double sr, int s, + struct db_ball *prev) { struct db_ball *ball; @@ -42,11 +45,13 @@ db_ball_new(int x, int y, int r, int a, int s, struct db_ball *prev) return NULL; } - ball->x = x; - ball->y = y; - ball->r = r; - ball->a = a; - ball->s = s; + ball->x = x; + ball->y = y; + ball->r = r; + ball->a = a; + ball->d = d; + ball->sr = sr; + ball->s = s; if (prev != NULL) { prev->next = ball; diff --git a/src/ball.h b/src/ball.h index 045cb22..4f36dc2 100644 --- a/src/ball.h +++ b/src/ball.h @@ -22,7 +22,7 @@ struct db_ball; -struct db_ball *db_ball_new(int x, int y, int r, int a, int s, +struct db_ball *db_ball_new(int x, int y, int r, int a, int d, double sr, int s, struct db_ball *prev); void db_balls_collisions(struct db_ball *ball_head); int db_balls_player_collisions(struct db_ball *ball_head, -- cgit v0.9.1