summaryrefslogtreecommitdiffstats
path: root/src/ball.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ball.c')
-rw-r--r--src/ball.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ball.c b/src/ball.c
new file mode 100644
index 0000000..7484950
--- /dev/null
+++ b/src/ball.c
@@ -0,0 +1,19 @@
+#include <stdlib.h>
+
+#include "ball.h"
+
+struct ball *
+new_ball(int x, int y)
+{
+ struct ball *b;
+
+ b = malloc(sizeof(*b));
+ if (b == NULL) {
+ return NULL;
+ }
+
+ b->x = x;
+ b->y = y;
+
+ return b;
+}