summaryrefslogtreecommitdiff
path: root/src/arena.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arena.c')
-rw-r--r--src/arena.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/arena.c b/src/arena.c
new file mode 100644
index 0000000..320a697
--- /dev/null
+++ b/src/arena.c
@@ -0,0 +1,37 @@
+
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+#include "arena.h"
+#include "list.h"
+#include "tux.h"
+#include "shot.h"
+#include "wall.h"
+#include "item.h"
+
+arena_t* newArena()
+{
+ arena_t *new;
+ new = malloc( sizeof(arena_t) );
+
+ new->background = NULL;
+ strcpy(new->music, "");
+
+ new->listTux = newList();
+ new->listShot = newList();
+ new->listWall = newList();
+ new->listItem = newList();
+
+ return new;
+}
+
+void destroyArena(arena_t *p)
+{
+ destroyListItem(p->listTux, destroyTux);
+ destroyListItem(p->listShot, destroyShot);
+ destroyListItem(p->listWall, destroyWall);
+ destroyListItem(p->listItem, destroyItem);
+
+ free(p);
+}