summaryrefslogtreecommitdiffstats
path: root/src/ball.c
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-05-21 17:50:37 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-05-21 17:50:37 (EDT)
commitd97f66ef26c89c8bd805cdeafffa959c91ec278b (patch)
tree96bf1eabfaece5ad310210dd40ea7f08543a15e0 /src/ball.c
parenta9c64a158c369bc370c14dd87567fc030fa050e0 (diff)
downloadcursespong-d97f66ef26c89c8bd805cdeafffa959c91ec278b.zip
cursespong-d97f66ef26c89c8bd805cdeafffa959c91ec278b.tar.gz
cursespong-d97f66ef26c89c8bd805cdeafffa959c91ec278b.tar.bz2
Add (stationary and invisible) balls to the board.
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;
+}